commit:     49ad90a829e2ea143388b9b7fa3bf1b12bd864ad
Author:     Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  3 11:03:42 2018 +0000
Commit:     Jason Donenfeld <zx2c4 <AT> gentoo <DOT> org>
CommitDate: Wed Jan  3 11:04:47 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49ad90a8

media-sound/aacgain: fix obvious bug and recent gcc issue

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 media-sound/aacgain/aacgain-1.9-r2.ebuild          | 105 +++++++++++++++++++++
 .../aacgain/files/aacgain-1.9-derefptr.patch       |  11 +++
 2 files changed, 116 insertions(+)

diff --git a/media-sound/aacgain/aacgain-1.9-r2.ebuild 
b/media-sound/aacgain/aacgain-1.9-r2.ebuild
new file mode 100644
index 00000000000..6db52b1805e
--- /dev/null
+++ b/media-sound/aacgain/aacgain-1.9-r2.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils autotools
+
+FAAD2_PV="2.7"
+MP4V2_PV="1.9.1"
+MP3GAIN_PV="1.5.2"
+
+DESCRIPTION="AACGain normalizes the volume of music files using the Replay 
Gain algorithm"
+HOMEPAGE="http://aacgain.altosdesign.com/";
+SRC_URI="http://sbriesen.de/gentoo/distfiles/${P}.tar.xz
+       https://mp4v2.googlecode.com/files/mp4v2-${MP4V2_PV}.tar.bz2
+       mirror://sourceforge/mp3gain/mp3gain-${MP3GAIN_PV//./_}-src.zip
+       mirror://sourceforge/faac/faad2-${FAAD2_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND=""
+
+DOCS="${PN}/README"
+
+src_unpack() {
+       mkdir -p "${S}"
+       for X in ${A}; do
+               case "${X}" in
+                       mp3gain*)
+                               mkdir -p "${S}/${X%%-*}"
+                               cd "${S}/${X%%-*}"
+                               unpack "${X}"
+                               ;;
+                       *)
+                               cd "${S}"
+                               unpack "${X}"
+                               [ -d "${X%%-*}" ] || mv -f "${X%%-*}"-* 
"${X%%-*}"
+                               ;;
+               esac
+       done
+}
+
+PATCHES=(
+       ${PN}/mp4v2.patch
+       "${FILESDIR}"/${P}-patch-dotdot.patch
+       "${FILESDIR}"/${P}-derefptr.patch
+)
+
+src_prepare() {
+       default
+
+       sed -i -e 's:iquote :I:' faad2/libfaad/Makefile.am || die
+       sed -i -e 's:../\(mp4v2/\):\1:g' ${PN}/mp4v2.patch || die
+       sed -i -e 's:\(libmp4v2\|libfaad/libfaad\)\.la:README:g' \
+               -e 's:^\(autoreconf\|pushd\|popd\):# \1:g' 
aacgain/linux/prepare.sh || die
+
+       cd "${S}/${PN}/linux"
+       sh prepare.sh || die "prepare failed!"
+
+       cd "${S}"
+       eautoreconf
+
+       cd "${S}/faad2"
+       eautoreconf
+
+       cd "${S}/mp4v2"
+       elibtoolize
+}
+
+src_configure() {
+       local myconf="--disable-dependency-tracking"
+       local myconf2="${myconf} --disable-shared --enable-static"
+
+       cd "${S}/faad2"
+       econf ${myconf2} --without-xmms --without-mpeg4ip
+
+       cd "${S}/mp4v2"
+       econf ${myconf2} --disable-gch
+
+       cd "${S}"
+       econf ${myconf}
+}
+
+src_compile() {
+       cd "${S}/faad2/libfaad"
+       emake
+
+       cd "${S}/mp4v2"
+       emake
+
+       cd "${S}"
+       emake
+}
+
+pkg_postinst() {
+       ewarn
+       ewarn "BACK UP YOUR MUSIC FILES BEFORE USING AACGAIN!"
+       ewarn "THIS IS EXPERIMENTAL SOFTWARE. THERE HAVE BEEN"
+       ewarn "BUGS IN PAST RELEASES THAT CORRUPTED MUSIC FILES."
+       ewarn
+}

diff --git a/media-sound/aacgain/files/aacgain-1.9-derefptr.patch 
b/media-sound/aacgain/files/aacgain-1.9-derefptr.patch
new file mode 100644
index 00000000000..6973f36bf1b
--- /dev/null
+++ b/media-sound/aacgain/files/aacgain-1.9-derefptr.patch
@@ -0,0 +1,11 @@
+--- aacgain-1.9/mp4v2/src/rtphint.cpp  2017-07-14 17:54:58.230117921 +0200
++++ aacgain-1.9/mp4v2/src/rtphint.cpp  2017-07-14 17:58:57.441883719 +0200
+@@ -345,7 +345,7 @@
+                 pSlash = strchr(pSlash, '/');
+                 if (pSlash != NULL) {
+                     pSlash++;
+-                    if (pSlash != '\0') {
++                    if (*pSlash != '\0') {
+                         length = strlen(pRtpMap) - (pSlash - pRtpMap);
+                         *ppEncodingParams = (char *)MP4Calloc(length + 1);
+                         strncpy(*ppEncodingParams, pSlash, length);

Reply via email to