summaryrefslogtreecommitdiff
blob: fca1550ca70ec66c95642a93d7807a1415a38f0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=4

inherit eutils

DESCRIPTION="Utility for stuffing image files (e.g. album cover art) into metadata blocks in 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"

SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="media-libs/flac"
RDEPEND="${DEPEND}"

S="${WORKDIR}"

# compile helper
_compile() {
	local CC="$(tc-getCC)"
	echo "${CC} ${@}" && "${CC}" "${@}"
}

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_compile() {
	# Makefile is both simple and broken, so we compile the binary ourself.
	_compile ${CFLAGS} ${LDFLAGS} -o "${PN}" "${PN}.c" -lFLAC \
	|| die "compile failed"
}

src_install() {
	dobin "${PN}"
}