commit: a61300708917d19556d18dfb93352817d5c687fe Author: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com> AuthorDate: Mon Nov 6 15:28:34 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Mon Nov 20 14:27:53 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6130070
media-libs/libmpg123: Add 1.32.3, split out from media-sound/mpg123 Bug: https://bugs.gentoo.org/915858 Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko <AT> gmail.com> Signed-off-by: Sam James <sam <AT> gentoo.org> media-libs/libmpg123/Manifest | 1 + .../mpg123-1.32.3-build-programs-component.patch | 55 +++++ .../mpg123-1.32.3-build-with-installed-libs.patch | 252 +++++++++++++++++++++ media-libs/libmpg123/libmpg123-1.32.3.ebuild | 104 +++++++++ media-libs/libmpg123/metadata.xml | 17 ++ profiles/arch/amd64/package.use.mask | 1 + .../prefix/darwin/macos/arch/ppc/package.use.mask | 1 + .../prefix/darwin/macos/arch/x64/package.use.mask | 1 + 8 files changed, 432 insertions(+) diff --git a/media-libs/libmpg123/Manifest b/media-libs/libmpg123/Manifest new file mode 100644 index 000000000000..1baeb7a33f18 --- /dev/null +++ b/media-libs/libmpg123/Manifest @@ -0,0 +1 @@ +DIST mpg123-1.32.3.tar.bz2 1111054 BLAKE2B 67f889403c2bb639d675ec5ebea5a19c4b7174971d62bdd8d940ad659e6b0c06dada38422fc9d71b878917aa89e305ec48c8faa78d65d507cd6a0c9a79951359 SHA512 946c1073b6eebfd65333ec543df1caeea25864479e9c8e153fb53d8b636cc756d8d81947f7b5cbedbbfb1ea664d3fb27562ed36e7726d95e80591bd2ad622afc diff --git a/media-libs/libmpg123/files/mpg123-1.32.3-build-programs-component.patch b/media-libs/libmpg123/files/mpg123-1.32.3-build-programs-component.patch new file mode 100644 index 000000000000..ea20c8a445f6 --- /dev/null +++ b/media-libs/libmpg123/files/mpg123-1.32.3-build-programs-component.patch @@ -0,0 +1,55 @@ +build: add programs component + +From: Igor V. Kovalenko <igor.v.kovale...@gmail.com> + +Upstream PR: https://github.com/madebr/mpg123/pull/11 +Bug: https://bugs.gentoo.org/915858 +--- + configure.ac | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index e47c7d5b..db37ff9b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -440,6 +440,21 @@ AC_ARG_ENABLE(libsyn123, + ] + ) + ++AC_ARG_ENABLE(programs, ++ [AS_HELP_STRING([--enable-programs], [build (only) programs (with --disable-components)])], ++ [ ++ if test "x$enableval" = xyes ++ then ++ build_programs=yes ++ else ++ build_programs=no ++ fi ++ ], ++ [ ++ build_programs=no ++ ] ++) ++ + if test "x$build_all" = xyes; then + build_programs=yes + build_libmpg123=yes +@@ -447,8 +462,6 @@ if test "x$build_all" = xyes; then + build_libout123_modules=yes + build_libsyn123=yes + components="programs" +-else +- build_programs=no + fi + + AM_CONDITIONAL([BUILD_PROGRAMS], [ test "x$build_programs" = xyes ]) +@@ -474,6 +487,9 @@ fi + if test "x$build_libsyn123" = xyes; then + components="$components libsyn123" + fi ++if test "x$build_programs" = xyes; then ++ components="$components programs" ++fi + components=$(echo $components) + + dnl ############## Configurable Options diff --git a/media-libs/libmpg123/files/mpg123-1.32.3-build-with-installed-libs.patch b/media-libs/libmpg123/files/mpg123-1.32.3-build-with-installed-libs.patch new file mode 100644 index 000000000000..aec0ef87ebbf --- /dev/null +++ b/media-libs/libmpg123/files/mpg123-1.32.3-build-with-installed-libs.patch @@ -0,0 +1,252 @@ +build: allow building with installed libmpg123 libsyn123 libout123 + +From: Igor V. Kovalenko <igor.v.kovale...@gmail.com> + +Upstream PR: https://github.com/madebr/mpg123/pull/11 +Bug: https://bugs.gentoo.org/915858 +--- + Makefile.am | 18 +++++++++++++++--- + configure.ac | 33 +++++++++++++++++++++++---------- + libmpg123.pc.in | 2 +- + libout123.pc.in | 2 +- + libsyn123.pc.in | 2 +- + src/Makemodule.am | 30 +++++++++++++++++++++++------- + src/libmpg123/Makemodule.am | 2 +- + src/libout123/Makemodule.am | 2 +- + src/libsyn123/Makemodule.am | 2 +- + 9 files changed, 67 insertions(+), 26 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 5b58dc4d..be3bfed0 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -37,13 +37,25 @@ AM_CPPFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\"" + AM_CPPFLAGS += \ + $(LTDLINCL) \ + -I$(top_srcdir)/src \ +- -I$(top_srcdir)/src/compat \ ++ -I$(top_srcdir)/src/compat ++ ++if BUILD_LIBMPG123 ++AM_CPPFLAGS += \ + -I$(top_srcdir)/src/libmpg123 \ ++ -I$(top_builddir)/src/libmpg123 ++endif ++ ++if BUILD_LIBSYN123 ++AM_CPPFLAGS += \ + -I$(top_srcdir)/src/libsyn123 \ ++ -I$(top_builddir)/src/libsyn123 ++endif ++ ++if BUILD_LIBOUT123 ++AM_CPPFLAGS += \ + -I$(top_srcdir)/src/libout123 \ +- -I$(top_builddir)/src/libmpg123 \ +- -I$(top_builddir)/src/libsyn123 \ + -I$(top_builddir)/src/libout123 ++endif + + # Include Make modules from subdirectories. + include src/Makemodule.am +diff --git a/configure.ac b/configure.ac +index db37ff9b..d782dbe5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -472,7 +472,7 @@ AM_CONDITIONAL([BUILD_LIBSYN123], [ test "x$build_libsyn123" = xyes ]) + AM_CONDITIONAL([NEED_FMT123], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libsyn123" = xyes ]) + # If we install libraries, prompting pkgconfig and include directories. + AM_CONDITIONAL([NEED_LIB], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libout123_modules" = xyes || test "x$build_libsyn123" = xyes ]) +-AM_CONDITIONAL([NEED_MAINLIB], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libsyn123" = xyes ]) ++AM_CONDITIONAL([NEED_MAINLIB], [ test "x$build_libmpg123" = xyes || test "x$build_libout123" = xyes || test "x$build_libsyn123" = xyes || test "x$build_programs" = xyes ]) + + + if test "x$build_libmpg123" = xyes; then +@@ -2911,15 +2911,28 @@ dnl ############## Library cleanup + + PROG_LIBS=$LIBS + LIBS= +-LIBMPG123_LIBS="$LIBM $COMPAT_LIBS" +-LIBSYN123_LIBS=$LIBM +-LIBOUT123_LIBS="$LIBRT $LIBM $COMPAT_LIBS" ++ ++if test "x$build_libmpg123" = xyes; then ++ LIBMPG123_DEP_LIBS="$LIBM $COMPAT_LIBS" ++else ++ PKG_CHECK_MODULES(LIBMPG123, libmpg123, HAVE_LIBMPG123="yes", HAVE_LIBMPG123="no" check_failed=yes) ++fi ++if test "x$build_libsyn123" = xyes; then ++ LIBSYN123_DEP_LIBS=$LIBM ++else ++ PKG_CHECK_MODULES(LIBSYN123, libsyn123, HAVE_LIBSYN123="yes", HAVE_LIBSYN123="no" check_failed=yes) ++fi ++if test "x$build_libout123" = xyes; then ++ LIBOUT123_DEP_LIBS="$LIBRT $LIBM $COMPAT_LIBS" ++else ++ PKG_CHECK_MODULES(LIBOUT123, libout123, HAVE_LIBOUT123="yes", HAVE_LIBOUT123="no" check_failed=yes) ++fi + + AC_SUBST(PROG_LIBS) + AC_SUBST(LIBM) +-AC_SUBST(LIBMPG123_LIBS) +-AC_SUBST(LIBSYN123_LIBS) +-AC_SUBST(LIBOUT123_LIBS) ++AC_SUBST(LIBMPG123_DEP_LIBS) ++AC_SUBST(LIBSYN123_DEP_LIBS) ++AC_SUBST(LIBOUT123_DEP_LIBS) + + dnl ############## Final Output + +@@ -3034,8 +3047,8 @@ echo " CFLAGS='$CFLAGS'" + echo " PROG_LIBS='$PROG_LIBS'" + echo " (derived from LIBS, only used for end-user binaries and modules)" + echo " LIBDL='$LIBDL'" +-echo " LIBMPG123_LIBS='$LIBMPG123_LIBS'" +-echo " LIBSYN123_LIBS='$LIBSYN123_LIBS'" +-echo " LIBOUT123_LIBS='$LIBOUT123_LIBS'" ++echo " LIBMPG123_DEP_LIBS='$LIBMPG123_DEP_LIBS'" ++echo " LIBSYN123_DEP_LIBS='$LIBSYN123_DEP_LIBS'" ++echo " LIBOUT123_DEP_LIBS='$LIBOUT123_DEP_LIBS'" + echo + echo "Next type 'make' and then 'make install'." +diff --git a/libmpg123.pc.in b/libmpg123.pc.in +index a8f692eb..c980a8c5 100644 +--- a/libmpg123.pc.in ++++ b/libmpg123.pc.in +@@ -8,5 +8,5 @@ Description: An optimised MPEG Audio decoder + Requires: + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lmpg123 +-Libs.private: @LIBMPG123_LIBS@ ++Libs.private: @LIBMPG123_DEP_LIBS@ + Cflags: -I${includedir} +diff --git a/libout123.pc.in b/libout123.pc.in +index fc4713f3..2c09778c 100644 +--- a/libout123.pc.in ++++ b/libout123.pc.in +@@ -8,5 +8,5 @@ Description: A streaming audio output API derived from mpg123 + Requires: + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lout123 +-Libs.private: @LIBOUT123_LIBS@ @LIBDL@ ++Libs.private: @LIBOUT123_DEP_LIBS@ @LIBDL@ + Cflags: -I${includedir} +diff --git a/libsyn123.pc.in b/libsyn123.pc.in +index 7e4ce2ed..60d0a572 100644 +--- a/libsyn123.pc.in ++++ b/libsyn123.pc.in +@@ -8,5 +8,5 @@ Description: A signal synthesis library accompanying mpg123 + Requires: + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lsyn123 +-Libs.private: @LIBSYN123_LIBS@ ++Libs.private: @LIBSYN123_DEP_LIBS@ + Cflags: -I${includedir} +diff --git a/src/Makemodule.am b/src/Makemodule.am +index b894a8aa..14dc8667 100644 +--- a/src/Makemodule.am ++++ b/src/Makemodule.am +@@ -3,10 +3,26 @@ + include src/tests/Makemodule.am + include src/compat/Makemodule.am + if NEED_LIB ++if BUILD_LIBOUT123 + include src/libout123/Makemodule.am ++LIBOUT123_LINK_LIBS = src/libout123/libout123.la ++else ++LIBOUT123_LINK_LIBS = @LIBOUT123_LIBS@ ++endif + if NEED_MAINLIB ++if BUILD_LIBMPG123 + include src/libmpg123/Makemodule.am ++LIBMPG123_LINK_LIBS = src/libmpg123/libmpg123.la ++else ++LIBMPG123_LINK_LIBS = @LIBMPG123_LIBS@ ++endif ++ ++if BUILD_LIBSYN123 + include src/libsyn123/Makemodule.am ++LIBSYN123_LINK_LIBS = src/libsyn123/libsyn123.la ++else ++LIBSYN123_LINK_LIBS = @LIBSYN123_LIBS@ ++endif + endif + endif + +@@ -22,17 +38,17 @@ endif + + src_mpg123_LDADD = \ + src/compat/libcompat.la \ +- src/libmpg123/libmpg123.la \ +- src/libout123/libout123.la \ +- src/libsyn123/libsyn123.la \ ++ ${LIBMPG123_LINK_LIBS} \ ++ ${LIBOUT123_LINK_LIBS} \ ++ ${LIBSYN123_LINK_LIBS} \ + @PROG_LIBS@ + + src_mpg123_LDFLAGS = @EXEC_LT_LDFLAGS@ + + src_out123_LDADD = \ + src/compat/libcompat.la \ +- src/libsyn123/libsyn123.la \ +- src/libout123/libout123.la \ ++ ${LIBSYN123_LINK_LIBS} \ ++ ${LIBOUT123_LINK_LIBS} \ + @PROG_LIBS@ + + src_out123_LDFLAGS = @EXEC_LT_LDFLAGS@ +@@ -46,12 +62,12 @@ CLEANFILES += src/*.a + + src_mpg123_id3dump_LDADD = \ + src/compat/libcompat.la \ +- src/libmpg123/libmpg123.la \ ++ ${LIBMPG123_LINK_LIBS} \ + @PROG_LIBS@ + + src_mpg123_strip_LDADD = \ + src/compat/libcompat.la \ +- src/libmpg123/libmpg123.la \ ++ ${LIBMPG123_LINK_LIBS} \ + @PROG_LIBS@ + + src_mpg123_SOURCES = \ +diff --git a/src/libmpg123/Makemodule.am b/src/libmpg123/Makemodule.am +index 48e3820f..7c64ea68 100644 +--- a/src/libmpg123/Makemodule.am ++++ b/src/libmpg123/Makemodule.am +@@ -34,7 +34,7 @@ src_libmpg123_libmpg123_la_LDFLAGS = \ + -export-symbols-regex '^mpg123_' + src_libmpg123_libmpg123_la_LIBADD = \ + src/compat/libcompat.la \ +- @LIBMPG123_LIBS@ ++ @LIBMPG123_DEP_LIBS@ + src_libmpg123_libmpg123_la_DEPENDENCIES = \ + src/compat/libcompat.la + +diff --git a/src/libout123/Makemodule.am b/src/libout123/Makemodule.am +index fcc5f87d..196b9de6 100644 +--- a/src/libout123/Makemodule.am ++++ b/src/libout123/Makemodule.am +@@ -55,7 +55,7 @@ src_libout123_libout123_la_LDFLAGS = \ + src_libout123_libout123_la_LIBADD = \ + src/libout123/libmodule.la \ + src/compat/libcompat.la \ +- @LIBOUT123_LIBS@ ++ @LIBOUT123_DEP_LIBS@ + + if HAVE_MODULES + +diff --git a/src/libsyn123/Makemodule.am b/src/libsyn123/Makemodule.am +index d85824fa..ff2a4848 100644 +--- a/src/libsyn123/Makemodule.am ++++ b/src/libsyn123/Makemodule.am +@@ -18,7 +18,7 @@ src_libsyn123_libsyn123_la_LDFLAGS = \ + + src_libsyn123_libsyn123_la_LIBADD = \ + src/compat/libcompat_str.la \ +- @LIBSYN123_LIBS@ ++ @LIBSYN123_DEP_LIBS@ + + src_libsyn123_libsyn123_la_SOURCES = \ + src/libsyn123/syn123.h \ diff --git a/media-libs/libmpg123/libmpg123-1.32.3.ebuild b/media-libs/libmpg123/libmpg123-1.32.3.ebuild new file mode 100644 index 000000000000..c431accb6960 --- /dev/null +++ b/media-libs/libmpg123/libmpg123-1.32.3.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PN="mpg123" +MY_P="${MY_PN}-${PV}" +inherit autotools flag-o-matic toolchain-funcs multilib-minimal + +DESCRIPTION="Libraries for realtime MPEG 1.0/2.0/2.5 audio player for layers 1, 2 and 3" +HOMEPAGE="https://www.mpg123.org/" +SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.tar.bz2" + +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="int-quality cpu_flags_x86_3dnow cpu_flags_x86_3dnowext cpu_flags_ppc_altivec cpu_flags_x86_mmx cpu_flags_x86_sse" + +# No MULTILIB_USEDEP here since we only build libmpg123 for non native ABIs. +# Note: build system prefers libsdl2 > libsdl. We could in theory add both +# but it's tricky when it comes to handling switching between them properly. +# We'd need a USE flag for both sdl1 and sdl2 and to make them clash. +RDEPEND=" + dev-libs/libltdl:0 + !<media-sound/mpg123-1.32.3-r1 +" +DEPEND="${RDEPEND}" +BDEPEND=" + sys-devel/libtool + virtual/pkgconfig +" +IDEPEND="app-eselect/eselect-mpg123" + +DOCS=( AUTHORS ChangeLog NEWS NEWS.libmpg123 README ) + +PATCHES=( + "${FILESDIR}"/mpg123-1.32.3-build-programs-component.patch + "${FILESDIR}"/mpg123-1.32.3-build-with-installed-libs.patch +) + +src_prepare() { + default + + # Rerun autotools with patched configure.ac + eautoreconf +} + +multilib_src_configure() { + local _audio=dummy + local _output=dummy + local _cpu=generic_fpu + + # Build fails without -D_GNU_SOURCE like this: + # error: ‘struct hostent’ has no member named ‘h_addr’ + append-cflags -D_GNU_SOURCE + + append-lfs-flags + + use cpu_flags_ppc_altivec && _cpu=altivec + + if [[ $(tc-arch) == amd64 || ${ARCH} == x64-* ]]; then + use cpu_flags_x86_sse && _cpu=x86-64 + elif use x86 && gcc-specs-pie ; then + # Don't use any mmx, 3dnow, sse and 3dnowext + # bug #164504 + _cpu=generic_fpu + else + use cpu_flags_x86_mmx && _cpu=mmx + use cpu_flags_x86_3dnow && _cpu=3dnow + use cpu_flags_x86_sse && _cpu=x86 + use cpu_flags_x86_3dnowext && _cpu=x86 + fi + + local myconf=( + --with-optimization=0 + --with-cpu=${_cpu} + --enable-int-quality=$(usex int-quality) + --disable-components --enable-libmpg123 --enable-libsyn123 --enable-libout123 + ) + + multilib_is_native_abi || myconf+=( --disable-modules ) + + ECONF_SOURCE="${S}" econf "${myconf[@]}" + + if ! $(multilib_is_native_abi) ; then + sed -i -e 's:src doc:src/libmpg123:' Makefile || die + fi +} + +multilib_src_install_all() { + einstalldocs + mv "${ED}"/usr/bin/mpg123{,-mpg123} + find "${ED}" -type f -name '*.la' -delete || die +} + +pkg_postinst() { + eselect mpg123 update ifunset +} + +pkg_postrm() { + eselect mpg123 update ifunset +} diff --git a/media-libs/libmpg123/metadata.xml b/media-libs/libmpg123/metadata.xml new file mode 100644 index 000000000000..120fdf73ceb1 --- /dev/null +++ b/media-libs/libmpg123/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>so...@gentoo.org</email> + <name>Gentoo Sound project</name> + </maintainer> + <upstream> + <maintainer> + <email>thomas-fo...@orgis.org</email> + <name>Thomas Orgis</name> + </maintainer> + </upstream> + <use> + <flag name="int-quality">Use rounding instead of fast truncation for integer output, where possible</flag> + </use> +</pkgmetadata> diff --git a/profiles/arch/amd64/package.use.mask b/profiles/arch/amd64/package.use.mask index 7acda262fc3c..ef0252d04e69 100644 --- a/profiles/arch/amd64/package.use.mask +++ b/profiles/arch/amd64/package.use.mask @@ -480,6 +480,7 @@ media-libs/smpeg cpu_flags_x86_mmx # x86_64 opts are enabled with USE sse. so masking the rest media-sound/mpg123 cpu_flags_x86_mmx cpu_flags_x86_3dnow cpu_flags_x86_3dnowext +media-libs/libmpg123 cpu_flags_x86_mmx cpu_flags_x86_3dnow cpu_flags_x86_3dnowext # Alexis Ballier <aball...@gentoo.org> (2008-08-08) # x86 asm only, it won't be built on amd64 if mmx useflag is enabled but that diff --git a/profiles/prefix/darwin/macos/arch/ppc/package.use.mask b/profiles/prefix/darwin/macos/arch/ppc/package.use.mask index 05af1b36b5b1..c31b5144bac6 100644 --- a/profiles/prefix/darwin/macos/arch/ppc/package.use.mask +++ b/profiles/prefix/darwin/macos/arch/ppc/package.use.mask @@ -12,3 +12,4 @@ media-libs/imlib2 cpu_flags_x86_mmx # Elias Pipping <pipp...@gentoo.org> (2007-09-01) # mpg123 does not compile with USE=mmx media-sound/mpg123 cpu_flags_x86_mmx +media-libs/libmpg123 cpu_flags_x86_mmx diff --git a/profiles/prefix/darwin/macos/arch/x64/package.use.mask b/profiles/prefix/darwin/macos/arch/x64/package.use.mask index f0e7d38c6427..02a3e779385d 100644 --- a/profiles/prefix/darwin/macos/arch/x64/package.use.mask +++ b/profiles/prefix/darwin/macos/arch/x64/package.use.mask @@ -8,6 +8,7 @@ media-libs/xvid -pic # Jeremy Olexa <darks...@gentoo.org> (2010-07-29) # Relocation issues on 32-bit OSX only, bug #329859 media-sound/mpg123 -cpu_flags_x86_mmx -cpu_flags_x86_sse +media-libs/libmpg123 -cpu_flags_x86_mmx -cpu_flags_x86_sse # Fabian Groffen <grob...@gentoo.org> (2009-02-01) # Doesn't compile on 32-bits OSX only, bug #257225