summaryrefslogtreecommitdiff
blob: 2f36641fab3962dc7c18aef1cf95c43521042e70 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/picard/picard-0.9.0_alpha14.ebuild,v 1.3 2007/09/16 21:43:33 coldwind Exp $

inherit eutils distutils

MY_P="${P/_/}"

DESCRIPTION="the next generation of tagger for MusicBrainz"
HOMEPAGE="http://musicbrainz.org/doc/PicardQt"
SRC_URI="http://ftp.musicbrainz.org/pub/musicbrainz/users/luks/picard-qt/${MY_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="cdaudio ffmpeg nls"

RDEPEND=">=dev-lang/python-2.4
	|| ( >=dev-lang/python-2.5 >=dev-python/ctypes-0.9 )
	>=dev-python/PyQt4-4.1
	>=x11-libs/qt-4.2
	>=media-libs/mutagen-1.9
	cdaudio? ( >=media-libs/libdiscid-0.1.1 )
	ffmpeg? ( >=media-video/ffmpeg-0.4.9
		>=media-libs/libofa-0.9.2 )"

DEPEND="${RDEPEND}"

DOCS="AUTHORS.txt INSTALL.txt NEWS.txt"
S=${WORKDIR}/${MY_P}

pkg_setup() {
	if ! use ffmpeg; then
		ewarn "The 'ffmpeg' USE flag is disabled. Acoustic fingerprinting and"
		ewarn "recognition will not be available!"
	fi
}

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}/${P}-disable-locales.patch"
}
src_compile() {
	${python} setup.py config || die "setup.py config failed"
	if ! use ffmpeg; then
		sed -i -e "s:\(^with-avcodec\ =\ \).*:\1False:" \
			-e "s:\(^with-libofa\ =\ \).*:\1False:" build.cfg || die "sed failed"
	fi

	local myconf
	use nls || myconf="--disable-locales"
	${python} setup.py build ${myconf} || die "setup.py build failed"

}

src_install() {
	local myconf
	use nls || myconf="--disable-locales"
	distutils_src_install --disable-autoupdate --skip-build ${myconf}
}

pkg_postinst() {
	distutils_pkg_postinst
	echo
	elog "You should set the environment variable BROWSER to something like"
	elog "\"firefox '%s' &\" to let python know which browser to use."
	echo
	if ! use cdaudio; then
		ewarn "The 'cdaudio' USE flag is disabled. CD index lookup and"
		ewarn "identification won't be available unless you install"
		ewarn "media-libs/libdiscid"
	fi
}