summaryrefslogtreecommitdiff
blob: 39466a1895b54ca73a0f5e6462bd159da3cd8f69 (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
75
76
77
78
79
80
81
82
83
84
85
86
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/beets/beets-1.0_rc2.ebuild,v 1.1 2013/01/02 23:18:22 sochotnicky Exp $

EAPI="4"

PYTHON_DEPEND="2:2.6"
PYTHON_USE_WITH="sqlite"
SUPPORT_PYTHON_ABIS="1"
#There a few test failures with 2.6, worth investigating
RESTRICT_PYTHON_ABIS="2.5 3.* 2.7-pypy-*"

inherit distutils

MY_PV=${PV/_rc/rc}
MY_P=${PN}-${MY_PV}

DESCRIPTION="A media library management system for obsessive-compulsive music geeks"
SRC_URI="http://beets.googlecode.com/files/${MY_P}.tar.gz"
HOMEPAGE="http://beets.radbox.org/"

KEYWORDS="~amd64 ~x86"
SLOT="0"
LICENSE="MIT"
IUSE="bpd chroma convert doc echonest_tempo lastgenre replaygain web"

RDEPEND="
	dev-python/munkres
	dev-python/python-musicbrainz-ngs
	dev-python/unidecode
	media-libs/mutagen
	bpd? ( dev-python/bluelet )
	chroma? ( dev-python/pyacoustid )
	convert? ( media-video/ffmpeg[encode] )
	doc? ( dev-python/sphinx )
	echonest_tempo? ( dev-python/pyechonest )
	lastgenre? ( dev-python/pylast )
	replaygain? ( || ( media-sound/mp3gain media-sound/aacgain ) )
	web? ( dev-python/flask )
"

DEPEND="${RDEPEND}
	dev-python/setuptools"

S=${WORKDIR}/${MY_P}

src_prepare() {
	distutils_src_prepare

	# remove plugins that do not have appropriate dependencies installed
	for flag in bpd chroma convert echonest_tempo lastgenre replaygain web;do
		if ! use $flag ; then
			rm -r beetsplug/$flag* || \
				die "Unable to remove $flag plugin"
		fi
	done

	for flag in bpd lastgenre web;do
		if ! use $flag ; then
			sed -i "s:'beetsplug.$flag',::" setup.py || \
				die "Unable to disable $flag plugin "
		fi
	done

	use bpd || rm -f test/test_player.py
}

src_compile() {
	distutils_src_compile
	use doc && emake -C docs html
}

src_test() {
	cd test
	testing() {
		PYTHONPATH="../build-${PYTHON_ABI}/lib" "$(PYTHON)" testall.py
	}
	python_execute_function testing
}

src_install() {
	distutils_src_install
	doman man/beet.1 man/beetsconfig.5

	use doc && dohtml -r docs/_build/html/
}