public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/mpg123/files/, media-sound/mpg123/
Date: Mon, 20 Nov 2023 14:29:14 +0000 (UTC)	[thread overview]
Message-ID: <1700490476.2c2663a76b16800dc83d1c8df19c99b4ddec0748.sam@gentoo> (raw)

commit:     2c2663a76b16800dc83d1c8df19c99b4ddec0748
Author:     Igor V. Kovalenko <igor.v.kovalenko <AT> gmail <DOT> com>
AuthorDate: Mon Nov  6 15:29:32 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 20 14:27:56 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c2663a7

media-sound/mpg123: Depend on media-libs/libmpg123

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>

 .../mpg123-1.32.3-build-programs-component.patch   |  55 +++++
 .../mpg123-1.32.3-build-with-installed-libs.patch  | 252 +++++++++++++++++++++
 media-sound/mpg123/mpg123-1.32.3-r1.ebuild         | 107 +++++++++
 3 files changed, 414 insertions(+)

diff --git a/media-sound/mpg123/files/mpg123-1.32.3-build-programs-component.patch b/media-sound/mpg123/files/mpg123-1.32.3-build-programs-component.patch
new file mode 100644
index 000000000000..ea20c8a445f6
--- /dev/null
+++ b/media-sound/mpg123/files/mpg123-1.32.3-build-programs-component.patch
@@ -0,0 +1,55 @@
+build: add programs component
+
+From: Igor V. Kovalenko <igor.v.kovalenko@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-sound/mpg123/files/mpg123-1.32.3-build-with-installed-libs.patch b/media-sound/mpg123/files/mpg123-1.32.3-build-with-installed-libs.patch
new file mode 100644
index 000000000000..aec0ef87ebbf
--- /dev/null
+++ b/media-sound/mpg123/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.kovalenko@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-sound/mpg123/mpg123-1.32.3-r1.ebuild b/media-sound/mpg123/mpg123-1.32.3-r1.ebuild
new file mode 100644
index 000000000000..11573bde1712
--- /dev/null
+++ b/media-sound/mpg123/mpg123-1.32.3-r1.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic multilib-minimal
+
+DESCRIPTION="a 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/${PN}/${P}.tar.bz2"
+
+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="alsa coreaudio int-quality ipv6 jack nas oss portaudio pulseaudio sdl"
+
+# 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="
+	~media-libs/libmpg123-${PV}[${MULTILIB_USEDEP},int-quality?]
+	dev-libs/libltdl:0
+	alsa? ( media-libs/alsa-lib )
+	jack? ( virtual/jack )
+	nas? ( media-libs/nas )
+	portaudio? ( media-libs/portaudio )
+	pulseaudio? ( media-libs/libpulse )
+	sdl? ( media-libs/libsdl2 )"
+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
+
+	# Upstream already applied the change to move shared internal implementation headers
+	# for next release, we just move them by hand now to fix build with patched sources.
+	mv src/libmpg123/{abi_align.h,debug.h,sample.h,swap_bytes_impl.h,true.h} src/ || die
+
+	# 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
+
+	if $(multilib_is_native_abi) ; then
+		local flag
+		for flag in nas portaudio sdl oss jack alsa pulseaudio coreaudio; do
+			if use ${flag}; then
+				_audio+=" ${flag/pulseaudio/pulse}"
+				_output=${flag/pulseaudio/pulse}
+			fi
+		done
+	fi
+
+	local myconf=(
+		--with-optimization=0
+		--with-audio="${_audio}"
+		--with-default-audio=${_output}
+		--enable-network
+		$(use_enable ipv6)
+		--disable-components
+	)
+
+	multilib_is_native_abi || myconf+=( --disable-modules )
+	multilib_is_native_abi && myconf+=( --enable-libout123-modules --enable-programs )
+
+	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
+}


                 reply	other threads:[~2023-11-20 14:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1700490476.2c2663a76b16800dc83d1c8df19c99b4ddec0748.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox