media-sound/lame: Fix compilation issues and missing deps
authorPacho Ramos <pacho@gentoo.org>
Sun, 10 Nov 2019 15:15:08 +0000 (16:15 +0100)
committerPacho Ramos <pacho@gentoo.org>
Sun, 10 Nov 2019 15:15:23 +0000 (16:15 +0100)
Closes: https://bugs.gentoo.org/516246
Closes: https://bugs.gentoo.org/662752
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
media-sound/lame/files/lame-3.100-symbols.patch [new file with mode: 0644]
media-sound/lame/lame-3.100-r2.ebuild [new file with mode: 0644]

diff --git a/media-sound/lame/files/lame-3.100-symbols.patch b/media-sound/lame/files/lame-3.100-symbols.patch
new file mode 100644 (file)
index 0000000..eb3a3b5
--- /dev/null
@@ -0,0 +1,16 @@
+--- lame-3.100/include/libmp3lame.sym  2017-09-06 14:33:35.000000000 -0500
++++ lame-3.100/include/libmp3lame.sym  2017-10-22 16:18:44.708436200 -0500
+@@ -1,5 +1,4 @@
+ lame_init
+-lame_init_old
+ lame_set_num_samples
+ lame_get_num_samples
+ lame_set_in_samplerate
+@@ -188,6 +187,7 @@ hip_decode_exit
+ hip_set_errorf
+ hip_set_debugf
+ hip_set_msgf
++hip_set_pinfo
+ hip_decode
+ hip_decode_headers
+ hip_decode1
diff --git a/media-sound/lame/lame-3.100-r2.ebuild b/media-sound/lame/lame-3.100-r2.ebuild
new file mode 100644 (file)
index 0000000..b0ad4bc
--- /dev/null
@@ -0,0 +1,81 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools multilib-minimal
+
+DESCRIPTION="LAME Ain't an MP3 Encoder"
+HOMEPAGE="http://lame.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug cpu_flags_x86_mmx +frontend mp3rtp sndfile static-libs"
+
+# These deps are without MULTILIB_USEDEP and are correct since we only build
+# libmp3lame for multilib and these deps apply to the lame frontend executable.
+RDEPEND="
+       frontend? (
+               >=sys-libs/ncurses-5.7-r7:0=
+               sndfile? ( >=media-libs/libsndfile-1.0.2 )
+       )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       sys-devel/gettext
+       virtual/pkgconfig
+       cpu_flags_x86_mmx? ( dev-lang/nasm )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.96-ccc.patch
+       "${FILESDIR}"/${PN}-3.98-gtk-path.patch
+       "${FILESDIR}"/${PN}-3.99.5-tinfo.patch
+       "${FILESDIR}"/${PN}-3.99.5-msse.patch
+       "${FILESDIR}"/${PN}-3.100-symbols.patch #662752
+)
+
+src_prepare() {
+       default
+
+       mkdir libmp3lame/i386/.libs || die #workaround parallel build with nasm
+
+       sed -i -e '/define sp/s/+/ + /g' libmp3lame/i386/nasm.h || die
+
+       use cpu_flags_x86_mmx || sed -i -e '/AC_PATH_PROG/s:nasm:dIsAbLe&:' configure.in #361879
+
+       mv configure.{in,ac} || die
+       AT_M4DIR=. eautoreconf
+}
+
+multilib_src_configure() {
+       # Only build the frontend for the default ABI.
+       local myconf=(
+               --disable-mp3x
+               --enable-dynamic-frontends
+               $(multilib_native_use_enable frontend)
+               $(multilib_native_use_enable mp3rtp)
+               $(multilib_native_usex sndfile '--with-fileio=sndfile' '')
+               $(use_enable debug debug norm)
+               $(use_enable static-libs static)
+               $(usex cpu_flags_x86_mmx '--enable-nasm' '') #361879
+       )
+
+       ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+       emake \
+               DESTDIR="${D}" \
+               pkghtmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
+               install
+}
+
+multilib_src_install_all() {
+       dodoc API ChangeLog HACKING README STYLEGUIDE TODO USAGE
+       docinto html
+       dodoc misc/lameGUI.html Dll/LameDLLInterface.htm
+
+       find "${D}" -name '*.la' -type f -delete || die
+}