commit:     e447517c5c9541ff57a63abd13851256ff2b166d
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Thu Nov 20 11:08:35 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 22 11:37:54 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e447517c

media-libs/a52dec: fix musl

use getopt from glibc/musl instead of outdated bundled lib

Closes: https://bugs.gentoo.org/944997
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/44685
Closes: https://github.com/gentoo/gentoo/pull/44685
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/a52dec/a52dec-0.7.4-r9.ebuild             |  4 ++++
 media-libs/a52dec/files/a52dec-0.7.4-rm_getopt.patch | 18 ++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/media-libs/a52dec/a52dec-0.7.4-r9.ebuild 
b/media-libs/a52dec/a52dec-0.7.4-r9.ebuild
index 952daa0a630c..5811ae7d4af9 100644
--- a/media-libs/a52dec/a52dec-0.7.4-r9.ebuild
+++ b/media-libs/a52dec/a52dec-0.7.4-r9.ebuild
@@ -23,6 +23,7 @@ PATCHES=(
        "${FILESDIR}"/${P}-tests-optional.patch
        "${FILESDIR}"/${P}-test-hidden-symbols.patch
        "${FILESDIR}"/${P}-dont-mangle-cflags.patch
+       "${FILESDIR}"/${P}-rm_getopt.patch
 )
 
 src_prepare() {
@@ -31,6 +32,9 @@ src_prepare() {
        sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die # 
bug #466978
        mv configure.{in,ac} || die
 
+       # use getopt.h from glibc/musl, bug 944997
+       rm src/getopt.h || die
+
        eautoreconf
 
        filter-flags -fprefetch-loop-arrays

diff --git a/media-libs/a52dec/files/a52dec-0.7.4-rm_getopt.patch 
b/media-libs/a52dec/files/a52dec-0.7.4-rm_getopt.patch
new file mode 100644
index 000000000000..f0823d6ba41a
--- /dev/null
+++ b/media-libs/a52dec/files/a52dec-0.7.4-rm_getopt.patch
@@ -0,0 +1,18 @@
+see https://bugs.gentoo.org/944997
+use getopt from glibc/musl instead, getopt.h must be removed too
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -1,10 +1,10 @@
+ 
+ bin_PROGRAMS = a52dec extract_a52
+-a52dec_SOURCES = a52dec.c getopt.c gettimeofday.c
++a52dec_SOURCES = a52dec.c gettimeofday.c
+ a52dec_LDADD = $(top_builddir)/liba52/liba52.la \
+              $(top_builddir)/libao/libao.a @LIBAO_LIBS@
+-extract_a52_SOURCES = extract_a52.c getopt.c
++extract_a52_SOURCES = extract_a52.c
+ 
+ man_MANS = a52dec.1 extract_a52.1
+ 
+-EXTRA_DIST = configure.incl getopt.h gettimeofday.h $(man_MANS)
++EXTRA_DIST = configure.incl gettimeofday.h $(man_MANS)

Reply via email to