media-sound/flac-image: [QA] Various fixes
authorDavid Seifert <soap@gentoo.org>
Sat, 3 Jun 2017 20:12:04 +0000 (22:12 +0200)
committerDavid Seifert <soap@gentoo.org>
Sat, 3 Jun 2017 20:52:06 +0000 (22:52 +0200)
Package-Manager: Portage-2.3.6, Repoman-2.3.2

media-sound/flac-image/files/flac-image-1.00-add-missing-string-include.patch [new file with mode: 0644]
media-sound/flac-image/files/flac-image-1.00-fix-build-system.patch [new file with mode: 0644]
media-sound/flac-image/flac-image-1.00.ebuild

diff --git a/media-sound/flac-image/files/flac-image-1.00-add-missing-string-include.patch b/media-sound/flac-image/files/flac-image-1.00-add-missing-string-include.patch
new file mode 100644 (file)
index 0000000..0ba842c
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/flac-image.c
++++ b/flac-image.c
+@@ -15,6 +15,7 @@
+  */
+ #include <stdio.h>
++#include <string.h>
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
diff --git a/media-sound/flac-image/files/flac-image-1.00-fix-build-system.patch b/media-sound/flac-image/files/flac-image-1.00-fix-build-system.patch
new file mode 100644 (file)
index 0000000..2cd8c53
--- /dev/null
@@ -0,0 +1,18 @@
+Fix Makefile to respect user variables
+
+--- a/Makefile
++++ b/Makefile
+@@ -3,9 +3,8 @@
+ # by default, you probably need to add -I/usr/whereever/flac to CFLAGS and
+ # -L/usr/lib/whereever to the link step.
+-CFLAGS="-Wall -g"
+-
+ flac-image: flac-image.o
+-      gcc -o flac-image -lFLAC flac-image.o
++      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lFLAC
+-flac-image: flac-image.c flac-image.h
+\ No newline at end of file
++flac-image.o: flac-image.c flac-image.h
++      $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
index 916e238fbae0d6fad87360a6d8c345ef6ffd8228..78ea6acddc7423cc7d6216f3a5a08ba8ba05e660 100644 (file)
@@ -1,16 +1,16 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=4
+EAPI=6
 
-inherit eutils
+inherit toolchain-funcs
 
-DESCRIPTION="Utility for stuffing image files (e.g. album cover art) into metadata blocks in FLAC files"
+DESCRIPTION="Utility for adding image files (e.g. album cover art) to metadata of FLAC files"
 HOMEPAGE="http://www.singingtree.com/software/"
 SRC_URI="http://www.singingtree.com/software/${PN}.tar.gz -> ${P}.tar.gz"
 # FIXME: no version in tarball, but also no updates for a long time. So it's ok.
-LICENSE="BSD"
 
+LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 IUSE=""
@@ -18,23 +18,18 @@ IUSE=""
 DEPEND="media-libs/flac"
 RDEPEND="${DEPEND}"
 
-S="${WORKDIR}"
+S=${WORKDIR}
 
-# compile helper
-_compile() {
-       local CC="$(tc-getCC)"
-       echo "${CC} ${@}" && "${CC}" "${@}"
-}
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.00-add-missing-string-include.patch
+       "${FILESDIR}"/${PN}-1.00-fix-build-system.patch
+)
 
-src_prepare() {
-       sed -i -e "s:^\(#include <stdio.h>\):\1\n#include <string.h>:g" "${PN}.c"
-       rm -f -- "${PN}"  # remove pre-compiled binary
-}
+src_configure() {
+       # remove pre-compiled binary
+       rm -f "${PN}" || die
 
-src_compile() {
-       # Makefile is both simple and broken, so we compile the binary ourself.
-       _compile ${CFLAGS} ${LDFLAGS} -o "${PN}" "${PN}.c" -lFLAC \
-       || die "compile failed"
+       tc-export CC
 }
 
 src_install() {