commit:     2a4aace21a902e93d93ee6cfe30cc47712f695aa
Author:     YOSHIOKA Takuma <lo48576 <AT> hard-wi <DOT> red>
AuthorDate: Mon Dec 30 18:59:56 2024 +0000
Commit:     YOSHIOKA Takuma <lo48576 <AT> hard-wi <DOT> red>
CommitDate: Mon Dec 30 19:00:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2a4aace2

media-sound/loudgain: add 0.6.8_p20240128

Signed-off-by: YOSHIOKA Takuma <lo48576 <AT> hard-wi.red>

 media-sound/loudgain/Manifest                      |  1 +
 .../files/loudgain-0.6.8-github-pr50-ffmpeg6.patch | 29 +++++++++++++
 .../loudgain-0.6.8-github-pr65-ffmpeg6-gcc14.patch | 23 ++++++++++
 .../loudgain/loudgain-0.6.8_p20240128.ebuild       | 49 ++++++++++++++++++++++
 4 files changed, 102 insertions(+)

diff --git a/media-sound/loudgain/Manifest b/media-sound/loudgain/Manifest
index 91a312e00..a7d7aed66 100644
--- a/media-sound/loudgain/Manifest
+++ b/media-sound/loudgain/Manifest
@@ -1 +1,2 @@
 DIST loudgain-0.6.8.tar.gz 27351854 BLAKE2B 
2f4cc5bb6d00a8b5a94183ca04041610ad629a7f869f4a474672316be4c8bb1bd6b1793cd1862f4c3e5b0e977b97d26047ec84792d67b1b4368bd21535c957fe
 SHA512 
e41bb6ee3dd85728b8b59b84a1371a88a439a30166db628fae70abe5c20cf9b6c450ee5b1aaa61c971de124cd9be9dbacac4b50f232f64c076d45aafc79ed94c
+DIST loudgain-079f82c613ea1e3597ad5e2cad077829fd75d2c9.tar.gz 26959123 BLAKE2B 
51bb771bc39ff94ddc57422c2069dd2c509af914db4272be8f722cd9ab24245375432afb5ac2b591de4899f7657350a9b736abecee9507ba6340ce189d377370
 SHA512 
bc0565450faf18569b6c865269c68331cf80fa33f274adedf89744321739c838e315320ec57bf2d6f71d23593ddbec368104df6f8f3932067fa50da5f4023715

diff --git 
a/media-sound/loudgain/files/loudgain-0.6.8-github-pr50-ffmpeg6.patch 
b/media-sound/loudgain/files/loudgain-0.6.8-github-pr50-ffmpeg6.patch
new file mode 100644
index 000000000..a35d259e0
--- /dev/null
+++ b/media-sound/loudgain/files/loudgain-0.6.8-github-pr50-ffmpeg6.patch
@@ -0,0 +1,29 @@
+From 977332e9e45477b1b41a5af7a2484f92b340413b Mon Sep 17 00:00:00 2001
+From: Hugh McMaster <[email protected]>
+Date: Thu, 1 Sep 2022 14:44:17 +1000
+Subject: [PATCH] src/scan.c: Only call av_register_all() if using libavformat
+ < 58.9.100
+
+This function is deprecated.
+
+Thanks to Leigh Scott for suggesting this patch.
+---
+ src/scan.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/scan.c b/src/scan.c
+index 85b36b3..ee72cf8 100644
+--- a/src/scan.c
++++ b/src/scan.c
+@@ -69,9 +69,9 @@ int scan_init(unsigned nb_files) {
+        * It is now useless
+        * 
https://github.com/FFmpeg/FFmpeg/blob/70d25268c21cbee5f08304da95be1f647c630c15/doc/APIchanges#L86
+        */
+-  if (avformat_version() < AV_VERSION_INT(58,9,100))
++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,9,100)
+     av_register_all();
+-
++#endif
+       av_log_set_callback(scan_av_log);
+ 
+       scan_nb_files = nb_files;

diff --git 
a/media-sound/loudgain/files/loudgain-0.6.8-github-pr65-ffmpeg6-gcc14.patch 
b/media-sound/loudgain/files/loudgain-0.6.8-github-pr65-ffmpeg6-gcc14.patch
new file mode 100644
index 000000000..eed9e6cc2
--- /dev/null
+++ b/media-sound/loudgain/files/loudgain-0.6.8-github-pr65-ffmpeg6-gcc14.patch
@@ -0,0 +1,23 @@
+From ad9c7f8ddf0907d408b3d2fbf4d00ecb55af8d13 Mon Sep 17 00:00:00 2001
+From: Hugh McMaster <[email protected]>
+Date: Mon, 29 Jul 2024 23:13:16 +1000
+Subject: [PATCH] src/scan.c: Declare "AVCodec" to be "const AVCodec"
+
+This fixes compilation with GCC-14.
+---
+ src/scan.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/scan.c b/src/scan.c
+index 85b36b3..e02ed86 100644
+--- a/src/scan.c
++++ b/src/scan.c
+@@ -115,7 +115,7 @@ int scan_file(const char *file, unsigned index) {
+ 
+       AVFormatContext *container = NULL;
+ 
+-      AVCodec *codec;
++      const AVCodec *codec;
+       AVCodecContext *ctx;
+ 
+       AVFrame *frame;

diff --git a/media-sound/loudgain/loudgain-0.6.8_p20240128.ebuild 
b/media-sound/loudgain/loudgain-0.6.8_p20240128.ebuild
new file mode 100644
index 000000000..c19c14175
--- /dev/null
+++ b/media-sound/loudgain/loudgain-0.6.8_p20240128.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+MY_COMMIT="079f82c613ea1e3597ad5e2cad077829fd75d2c9"
+MY_P="${PN}-${MY_COMMIT}"
+
+DESCRIPTION="Versatile ReplayGain 2.0 loudness normalizer"
+HOMEPAGE="https://github.com/Moonbase59/loudgain";
+SRC_URI="https://github.com/Moonbase59/${PN}/archive/079f82c613ea1e3597ad5e2cad077829fd75d2c9.tar.gz
 -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+#REQUIRED_USE=""
+
+# FFmpeg 7 introduced API breaking change that affects loudgain.
+# See <https://github.com/Moonbase59/loudgain/issues/67>.
+COMMON_DEPEND="
+       <media-video/ffmpeg-7:=
+       media-libs/libebur128
+       media-libs/taglib
+"
+RDEPEND="${COMMON_DEPEND}"
+DEPEND="${COMMON_DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/loudgain-0.6.8-github-pr50-ffmpeg6.patch"
+       "${FILESDIR}/loudgain-0.6.8-github-pr65-ffmpeg6-gcc14.patch"
+)
+
+src_prepare() {
+       sed -e 's/^SET(CMAKE_C_FLAGS "/SET(CMAKE_C_FLAGS "${CMAKE_C_CFLAGS} /' \
+               -e 's/^SET(CMAKE_CXX_FLAGS "/SET(CMAKE_CXX_FLAGS 
"${CMAKE_CXX_FLAGS} /' \
+               -e 's/^\(\s*COMPILE_FLAGS.*\) -g\([\s"]\)$/\1\2/' \
+               -i CMakeLists.txt || die "cannot patch CMakeLists.txt"
+       cat CMakeLists.txt
+
+       cmake_src_prepare
+}
+
+src_install() {
+       cmake_src_install
+       dodoc README.md
+}

Reply via email to