commit: c48cea02d96d269076d82837d4b46e6e45e24552 Author: Alfred Wingate <parona <AT> protonmail <DOT> com> AuthorDate: Wed Jul 23 18:52:48 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Sep 4 20:46:53 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c48cea02
media-sound/sox: add 14.6.0.2 Migrate to a new upstream. Enable build option to include backwards compatibility symlinks. Renaming the package could be idea in the future. New use flags are speexdsp, fftw and ffmpeg. Upstream recommends ffmpeg to be enabled by default. Closes: https://bugs.gentoo.org/960558 Signed-off-by: Alfred Wingate <parona <AT> protonmail.com> Part-of: https://github.com/gentoo/gentoo/pull/43149 Signed-off-by: Sam James <sam <AT> gentoo.org> media-sound/sox/Manifest | 1 + .../sox/files/sox-14.6.0.2-fix-symlinks.patch | 116 +++++++++++++++++++++ media-sound/sox/metadata.xml | 2 + media-sound/sox/sox-14.6.0.2.ebuild | 116 +++++++++++++++++++++ 4 files changed, 235 insertions(+) diff --git a/media-sound/sox/Manifest b/media-sound/sox/Manifest index e188c594038a..375678ec78d6 100644 --- a/media-sound/sox/Manifest +++ b/media-sound/sox/Manifest @@ -1,2 +1,3 @@ DIST sox-14.4.2_p20210509-patchset.tar.xz 3560 BLAKE2B 8f575dbff121d749c83c6074dadeb92475472f36ad5b9c389e1591b60cff853167c22f7c059731fa5b78c497817bcae6be93ace21bfe605faf2445301a0fe2af SHA512 4b57689bc85ac7664693c6344fd17c7fc7991e04d5e6628c2455c8e541ecfec073690d4dc23a909474ba93fd24cd877aa77f1e7fcc5b52773daa794689212bb8 DIST sox-14.4.2_p20210509.zip 942551 BLAKE2B 2ddd229faacb9190fe18052b1c02da40d4c3f24fc73dd08b28ac99bef267cb05f8bcbf64e0c397c391b3be2467667783ed94f6c60798af069567e1c237ec9ccd SHA512 4868f9b77141b7e2caf2571ceb68a48bd744732e72f63ed787f8e0b9fe39b77de4e998b32d99c2500e10b017a1fd1a3379f4f9f8b67db6093b85d02cb3447934 +DIST sox_ng-14.6.0.2.tar.gz 1746640 BLAKE2B 76380ba885e6570ecea30466d6d804747983a940ac7a5c3347f4844bb0054b1a476227543aaa70ad6703634bd434e76824dbea375821ba3ba96a63321707c6a3 SHA512 9468cd15b83b2500210d54355ed5d7ae2a97171148b8a54c47007d1a7d9c57e378211c0429ee4d8065f0ba5ab97b31c9abb8795b659585c523942c044fe49b1d diff --git a/media-sound/sox/files/sox-14.6.0.2-fix-symlinks.patch b/media-sound/sox/files/sox-14.6.0.2-fix-symlinks.patch new file mode 100644 index 000000000000..8c39e488caa9 --- /dev/null +++ b/media-sound/sox/files/sox-14.6.0.2-fix-symlinks.patch @@ -0,0 +1,116 @@ +https://codeberg.org/sox_ng/sox_ng/pulls/528 +https://codeberg.org/sox_ng/sox_ng/commit/9418f8acd129880d0787b4a4e1ff6f4f884c145d +https://codeberg.org/sox_ng/sox_ng/commit/02d5fb9c7e98e0d729938882e1a16066c2ff5f21 + +From 3d9731e5aa7ca492c626e4e3740bb9f8216042b4 Mon Sep 17 00:00:00 2001 +From: Alfred Wingate <[email protected]> +Date: Thu, 24 Jul 2025 03:37:04 +0300 +Subject: [PATCH 1/2] Fix symlink creation with unlucky ordering in destdir + installs + +Headers and pkgconfig files are both data files so they would be +appropriate for install-data-hook. In addition the pkgconfig file is +handled in the root Makefile.am, so it belongs there. + +Potentially the install hooks could be executed first in src/Makefile.am +before the normal install is handled from the root Makefile.am. + +Noticed due to: + +/bin/sh: line 20: cd: /var/tmp/portage/media-sound/sox-14.6.0.2/image/usr/lib64/pkgconfig: No such file or directo + +Leading to the installation of: /usr/lib64/sox.pc -> sox_ng.pc +--- a/Makefile.am ++++ b/Makefile.am +@@ -153,6 +153,10 @@ install-data-hook: + cd $(DESTDIR)$(mandir)/man1 && $(RM) soxi.1 && \ + $(LN_S) soxi_ng.1 soxi.1; \ + fi; \ ++ if test "$(pkgconfigdir)"; then \ ++ cd $(DESTDIR)$(pkgconfigdir); \ ++ $(RM) "sox.pc"; $(LN_S) sox_ng.pc sox.pc; \ ++ fi; \ + fi + + uninstall-hook: +@@ -173,6 +177,10 @@ uninstall-hook: + if test "$(SYMLINKS)" = "yes"; then \ + $(RM) $(DESTDIR)$(mandir)/man1/soxi.1; \ + fi; \ ++ if test "$(pkgconfigdir)"; then \ ++ cd $(DESTDIR)$(pkgconfigdir); \ ++ $(RM) "sox.pc"; \ ++ fi; \ + fi + + # Automatically update libtool script if it gets out-of-date +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -200,16 +200,16 @@ install-exec-hook: + $(RM) soxi$(EXEEXT); \ + $(LN_S) soxi_ng$(EXEEXT) soxi$(EXEEXT); \ + fi; \ +- cd $(DESTDIR)$(includedir); \ +- $(RM) sox.h; $(LN_S) sox_ng.h sox.h; \ + cd $(DESTDIR)$(libdir); \ + $(RM) libsox.a; $(LN_S) libsox_ng.a libsox.a; \ + $(RM) libsox.la; $(LN_S) libsox_ng.la libsox.la; \ + $(RM) libsox.so; $(LN_S) libsox_ng.so libsox.so; \ +- if test "$(pkgconfigdir)"; then \ +- cd $(DESTDIR)$(pkgconfigdir); \ +- $(RM) "sox.pc"; $(LN_S) sox_ng.pc sox.pc; \ +- fi; \ ++ fi ++ ++install-data-hook: ++ @if test "$(REPLACE)" = "yes"; then \ ++ cd $(DESTDIR)$(includedir); \ ++ $(RM) sox.h; $(LN_S) sox_ng.h sox.h; \ + fi + + uninstall-hook: +@@ -231,10 +231,6 @@ uninstall-hook: + cd $(DESTDIR)$(includedir); $(RM) sox.h;\ + cd $(DESTDIR)$(libdir); \ + $(RM) libsox.a libsox.la libsox.so; \ +- if test "$pkgconfigdir"; then \ +- cd $(DESTDIR)$(pkfconfigdir); \ +- $(RM) "sox.pc";\ +- fi; \ + fi + + clean-local: +-- +2.50.1 + +From 41c1a4818808d9936d1ec704d176f94c601f9ebc Mon Sep 17 00:00:00 2001 +From: Alfred Wingate <[email protected]> +Date: Thu, 24 Jul 2025 03:59:13 +0300 +Subject: [PATCH 2/2] Create symlinks for libraries only if the library exists + +Otherwise the symlinks will be created unconditionally even static +libraries were disabled with --disable-static. +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -201,9 +201,15 @@ install-exec-hook: + $(LN_S) soxi_ng$(EXEEXT) soxi$(EXEEXT); \ + fi; \ + cd $(DESTDIR)$(libdir); \ +- $(RM) libsox.a; $(LN_S) libsox_ng.a libsox.a; \ +- $(RM) libsox.la; $(LN_S) libsox_ng.la libsox.la; \ +- $(RM) libsox.so; $(LN_S) libsox_ng.so libsox.so; \ ++ if test -f libsox_ng.a; then \ ++ $(RM) libsox.a; $(LN_S) libsox_ng.a libsox.a; \ ++ fi; \ ++ if test -f libsox_ng.la; then \ ++ $(RM) libsox.la; $(LN_S) libsox_ng.la libsox.la; \ ++ fi; \ ++ if test -f libsox_ng.so; then \ ++ $(RM) libsox.so; $(LN_S) libsox_ng.so libsox.so; \ ++ fi; \ + fi + + install-data-hook: +-- +2.50.1 + diff --git a/media-sound/sox/metadata.xml b/media-sound/sox/metadata.xml index 59bdfdf971d4..f9e623283118 100644 --- a/media-sound/sox/metadata.xml +++ b/media-sound/sox/metadata.xml @@ -9,9 +9,11 @@ <flag name="amr">Enables Adaptive Multi-Rate Audio support</flag> <flag name="id3tag">Enables ID3 tagging with id3tag library</flag> <flag name="sndio">Enable support for sndio</flag> + <flag name="speexdsp">Support for automatic gain control, denoise and dereverb with <pkg>media-libs/speexdsp</pkg></flag> <flag name="twolame">Enables twolame support (MPEG Audio Layer 2 encoder)</flag> </use> <upstream> + <remote-id type="codeberg">sox_ng/sox_ng</remote-id> <remote-id type="cpe">cpe:/a:soundexchange:sound_exchange</remote-id> <remote-id type="sourceforge">sox</remote-id> </upstream> diff --git a/media-sound/sox/sox-14.6.0.2.ebuild b/media-sound/sox/sox-14.6.0.2.ebuild new file mode 100644 index 000000000000..9f1a012d11a5 --- /dev/null +++ b/media-sound/sox/sox-14.6.0.2.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic + +MY_PN="sox_ng" +MY_PV="${PV/_rc/-rc}" +MY_P="${MY_PN}-${MY_PV}" + +DESCRIPTION="The swiss army knife of sound processing programs" +HOMEPAGE="https://codeberg.org/sox_ng/sox_ng" +SRC_URI="https://codeberg.org/sox_ng/sox_ng/releases/download/${MY_P}/${MY_P}.tar.gz" +S="${WORKDIR}/${MY_P}" + +# https://codeberg.org/sox_ng/sox_ng/wiki/Copyright +LICENSE="GPL-2" +SLOT="0/3" # SHLIB_VERSION in configure.ac +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="alsa amr ao encode +ffmpeg fftw flac id3tag ladspa mad ogg openmp oss opus png pulseaudio sndfile sndio speexdsp twolame wavpack" + +RDEPEND=" + dev-libs/libltdl:0= + >=media-sound/gsm-1.0.12-r1 + sys-apps/file + alsa? ( media-libs/alsa-lib ) + amr? ( media-libs/opencore-amr ) + ao? ( media-libs/libao:= ) + encode? ( >=media-sound/lame-3.98.4 ) + ffmpeg? ( media-video/ffmpeg ) + fftw? ( sci-libs/fftw:3.0= ) + flac? ( >=media-libs/flac-1.1.3:= ) + id3tag? ( media-libs/libid3tag:= ) + ladspa? ( media-libs/ladspa-sdk ) + mad? ( media-libs/libmad ) + ogg? ( + media-libs/libogg + media-libs/libvorbis + ) + opus? ( + media-libs/opus + media-libs/opusfile + ) + png? ( + media-libs/libpng:0= + sys-libs/zlib + ) + pulseaudio? ( media-libs/libpulse ) + sndfile? ( >=media-libs/libsndfile-1.0.11 ) + sndio? ( media-sound/sndio:= ) + speexdsp? ( + media-libs/speex + media-libs/speexdsp + ) + twolame? ( media-sound/twolame ) + wavpack? ( media-sound/wavpack ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + virtual/pkgconfig +" + +DOCS=( AUTHORS ChangeLog ) + +PATCHES=( + "${FILESDIR}"/sox-14.6.0.2-fix-symlinks.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + # Workaround for LLD (bug #914867) + # https://codeberg.org/sox_ng/sox_ng/issues/69 + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) + local myeconfargs=( + $(use_with alsa) + $(use_with amr amrnb) + $(use_with amr amrwb) + $(use_with ao) + $(use_with encode lame) + $(use_with ffmpeg) + $(use_with fftw) + $(use_with flac) + $(use_with id3tag) + $(use_with ladspa ladspa dyn) + $(use_with mad) + --with-magic + $(use_enable openmp) + $(use_with ogg oggvorbis) + $(use_with oss) + $(use_with opus) + $(use_with png) + $(use_with pulseaudio) + $(use_with sndfile) + $(use_with sndio) + $(use_with speexdsp) + $(use_with twolame) + $(use_with wavpack) + + --with-dyn-default + --enable-replace # bug #960558 + --disable-debug # user cflags + --with-distro="Gentoo" + + ) + econf "${myeconfargs[@]}" +} + +src_install() { + default + find "${ED}" \( -type f -or -type l \) -name '*.la' -delete || die +}
