summaryrefslogtreecommitdiff
blob: a6af42a620e31c90abfa0e0b8377221944225c6a (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/aubio/aubio-0.3.2-r1.ebuild,v 1.11 2011/10/01 10:08:12 ssuominen Exp $

EAPI=3

PYTHON_DEPEND="2:2.6"

inherit autotools eutils python

DESCRIPTION="Library for audio labelling"
HOMEPAGE="http://aubio.piem.org"
SRC_URI="http://aubio.piem.org/pub/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~ppc ppc64 sparc x86"
IUSE="alsa doc jack lash static-libs"

RDEPEND="sci-libs/fftw:3.0
	media-libs/libsndfile
	media-libs/libsamplerate
	|| ( dev-lang/python:2.7 dev-lang/python:2.6 )
	alsa? ( media-libs/alsa-lib )
	jack? ( media-sound/jack-audio-connection-kit )
	lash? ( media-sound/lash )"
DEPEND="${RDEPEND}
	>=dev-lang/swig-1.3.0
	dev-util/pkgconfig
	doc? ( app-doc/doxygen virtual/latex-base )"

pkg_setup() {
	DOCS=( AUTHORS ChangeLog README TODO )

	python_set_active_version 2
	python_pkg_setup
}

src_prepare() {
	epatch "${FILESDIR}"/aubio-0.3.2-multilib.patch
	eautoreconf
}

src_configure() {
	econf \
		$(use_enable static-libs static) \
		$(use_enable jack) \
		$(use_enable alsa) \
		$(use_enable lash)
}

src_compile() {
	default

	if use doc; then
		export VARTEXFONTS="${T}/fonts"
		cd "${S}"/doc
		doxygen user.cfg
		doxygen devel.cfg
		doxygen examples.cfg
	fi
}

src_install() {
	# `default` would be enough here if python.eclass supported EAPI=4
	emake DESTDIR="${D}" install || die
	dodoc "${DOCS[@]}"

	doman doc/*.1
	if use doc; then
		mv doc/user/html doc/user/user
		dohtml -r doc/user/user
		mv doc/devel/html doc/devel/devel
		dohtml -r doc/devel/devel
		mv doc/examples/html doc/examples/examples
		dohtml -r doc/examples/examples
	fi

	find "${ED}"usr -name '*.la' -exec rm -f {} +
}

pkg_postinst() { python_mod_optimize aubio; }
pkg_postrm() { python_mod_cleanup aubio; }