summaryrefslogtreecommitdiff
blob: 203d7469bd7d4d3916facc62f8e7c2e2fcd2b1d8 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-libs/aubio/aubio-0.4.0.ebuild,v 1.1 2014/01/18 12:13:59 aballier Exp $

EAPI=5

PYTHON_COMPAT=( python2_7 )

inherit distutils-r1 waf-utils multilib

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

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="doc double-precision examples ffmpeg fftw jack libsamplerate sndfile python"

RDEPEND="
	ffmpeg? ( virtual/ffmpeg )
	fftw? ( sci-libs/fftw:3.0 )
	jack? ( media-sound/jack-audio-connection-kit )
	libsamplerate? ( media-libs/libsamplerate )
	python? ( dev-python/numpy[${PYTHON_USEDEP}] ${PYTHON_DEPS} )
	sndfile? ( media-libs/libsndfile )"
DEPEND="${RDEPEND}
	virtual/pkgconfig
	app-text/txt2man
	doc? ( app-doc/doxygen )"

DOCS=( AUTHORS ChangeLog README.md )
PYTHON_SRC_DIR="${S}/python"

src_prepare() {
	sed -i -e "s:\/lib:\/$(get_libdir):" src/wscript_build || die
	sed -i -e "s:doxygen:doxygen_disabled:" wscript || die

	if use python ; then
		cd "${PYTHON_SRC_DIR}"
		distutils-r1_src_prepare
	fi
}

src_configure() {
	waf-utils_src_configure \
		--enable-complex \
		--docdir="${EPREFIX}"/usr/share/doc/${PF} \
		$(use_enable double-precision double) \
		$(use_enable fftw fftw3f) \
		$(use_enable fftw fftw3) \
		$(use_enable ffmpeg avcodec) \
		$(use_enable jack) \
		$(use_enable libsamplerate samplerate) \
		$(use_enable sndfile)

	if use python ; then
		cd "${PYTHON_SRC_DIR}"
		distutils-r1_src_configure
	fi
}

src_compile() {
	waf-utils_src_compile --notests

	if use doc; then
		cd "${S}"/doc
		doxygen full.cfg || die
	fi

	if use python ; then
		cd "${PYTHON_SRC_DIR}"
		distutils-r1_src_compile
	fi
}

src_test() {
	waf-utils_src_compile --alltests

	if use python ; then
		cd "${PYTHON_SRC_DIR}"
		distutils-r1_src_test
	fi
}

src_install() {
	waf-utils_src_install

	if use python ; then
		cd "${PYTHON_SRC_DIR}"
		DOCS="README" distutils-r1_src_install
	fi

	if use doc; then
		dohtml -r doc/full/html/*
		dodoc doc/*.txt
	fi

	if use examples; then
		# install dist_noinst_SCRIPTS from Makefile.am
		insinto /usr/share/doc/${PF}/examples
		doins examples/*
	fi
}