commit:     fc022648fe534a07c2c4c4d3ac0f492ec9caa298
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed May 28 10:54:25 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 28 10:54:51 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc022648

media-sound/normalize: EAPI 8, fix C23 issue

Fix a silly trick being used there that causes problems rather than
fixing any.

Closes: https://bugs.gentoo.org/944353
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../normalize/files/normalize-0.7.7-c23.patch      | 27 +++++++++++
 media-sound/normalize/normalize-0.7.7-r2.ebuild    | 53 ++++++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/media-sound/normalize/files/normalize-0.7.7-c23.patch 
b/media-sound/normalize/files/normalize-0.7.7-c23.patch
new file mode 100644
index 000000000000..f1c1386dc029
--- /dev/null
+++ b/media-sound/normalize/files/normalize-0.7.7-c23.patch
@@ -0,0 +1,27 @@
+https://bugs.gentoo.org/944353
+--- a/nid3lib/write.c
++++ b/nid3lib/write.c
+@@ -20,7 +20,7 @@
+  * id3_write(), and many helper functions.
+  */
+ 
+-#define _POSIX_C_SOURCE 2
++#define _GNU_SOURCE
+ 
+ #include "config.h"
+ 
+@@ -59,14 +59,6 @@
+ #if HAVE_INTTYPES_H
+ # include <inttypes.h>
+ #endif
+-#if HAVE_FTRUNCATE
+-/*
+- * ftruncate() shouldn't be declared yet, since we turn on
+- * _POSIX_C_SOURCE, but you never know, so we use an old style
+- * declaration to lessen the chance of conflict.
+- */
+-int ftruncate();
+-#endif
+ 
+ #include "nid3P.h"
+ 

diff --git a/media-sound/normalize/normalize-0.7.7-r2.ebuild 
b/media-sound/normalize/normalize-0.7.7-r2.ebuild
new file mode 100644
index 000000000000..b33f04ea0a0e
--- /dev/null
+++ b/media-sound/normalize/normalize-0.7.7-r2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Audio file volume normalizer"
+HOMEPAGE="http://normalize.nongnu.org/";
+SRC_URI="
+       https://savannah.nongnu.org/download/${PN}/${P}.tar.bz2
+       https://dev.gentoo.org/~radhermit/distfiles/${P}-m4.patch.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="audiofile mad nls"
+
+RDEPEND="
+       audiofile? ( media-libs/audiofile:= )
+       mad? ( media-libs/libmad:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       virtual/pkgconfig
+       nls? ( dev-util/intltool )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-audiofile-pkgconfig.patch
+       "${WORKDIR}"/${P}-m4.patch
+       "${FILESDIR}"/${P}-c23.patch
+)
+
+src_prepare() {
+       default
+       AT_M4DIR="." eautoreconf
+}
+
+src_configure() {
+       econf \
+               $(use_with audiofile) \
+               $(use_with mad) \
+               $(use_enable nls) \
+               --disable-xmms
+}
+
+src_test() {
+       # .sh tests missing a dep on ../src/mktestwav but ancient 
autoconf/automake
+       # so too much hassle to patch, bug #740488.
+       emake -j1 check
+}

Reply via email to