app-cdr/cuecue: Fix building with CFLAGS=-fno-common
authorJeroen Roovers <jer@gentoo.org>
Fri, 15 May 2020 07:25:18 +0000 (09:25 +0200)
committerJeroen Roovers <jer@gentoo.org>
Fri, 15 May 2020 07:33:41 +0000 (09:33 +0200)
Also:
- Drop flag-o-matic
- Set AR
- Set RDEPEND

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Closes: https://bugs.gentoo.org/show_bug.cgi?id=707444
Closes: https://bugs.gentoo.org/show_bug.cgi?id=722024
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
app-cdr/cuecue/cuecue-0.2.2-r3.ebuild [new file with mode: 0644]
app-cdr/cuecue/files/cuecue-0.2.2-fno-common.patch [new file with mode: 0644]

diff --git a/app-cdr/cuecue/cuecue-0.2.2-r3.ebuild b/app-cdr/cuecue/cuecue-0.2.2-r3.ebuild
new file mode 100644 (file)
index 0000000..03166b1
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs
+
+DESCRIPTION="Cuecue converts .cue + [.ogg|.flac|.wav|.mp3] to .cue + .bin"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# Enable one use flag by default, bug 254745"
+IUSE="flac mp3 +vorbis"
+REQUIRED_USE="|| ( flac mp3 vorbis )"
+
+DEPEND="
+       flac? ( media-libs/flac )
+       mp3? ( media-libs/libmad )
+       vorbis? ( media-libs/libvorbis media-libs/libogg )
+"
+RDEPEND="
+       ${DEPEND}
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-flac113.diff # bug 157706
+       "${FILESDIR}"/${P}-namespace.patch
+       "${FILESDIR}"/${P}-unused.patch
+       "${FILESDIR}"/${P}-fno-common.patch
+)
+
+src_configure() {
+       econf \
+               $(use_enable flac) \
+               $(use_enable mp3) \
+               $(use_enable vorbis ogg) \
+               --disable-libFLACtest \
+               --disable-oggtest \
+               --disable-vorbistest
+}
+
+src_compile() {
+       emake AR="$(tc-getAR)" CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+       default
+
+       insinto /usr/include
+       doins src/libcuecue/cuecue.h
+}
diff --git a/app-cdr/cuecue/files/cuecue-0.2.2-fno-common.patch b/app-cdr/cuecue/files/cuecue-0.2.2-fno-common.patch
new file mode 100644 (file)
index 0000000..9eb8b18
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/libcuecue/cuecue_internal.h
++++ b/src/libcuecue/cuecue_internal.h
+@@ -57,7 +57,7 @@
+ typedef int (*FUNC_DECODER)(char* file_source, char* file_destination, PROGRESS_CALLBACK callback);\r
\r
+ #define CUECUE_ERROR_LENGTH 1024\r
+-char cuecue_error[CUECUE_ERROR_LENGTH];\r
++extern char cuecue_error[CUECUE_ERROR_LENGTH];\r
\r
+ #endif /* __CUECUE_INTERNAL__ */\r
\r