media-libs/allegro: Fix automagic building of 4.4.3.1 texinfo docs
[gentoo.git] / media-libs / aubio / aubio-0.4.7-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 DISTUTILS_OPTIONAL=1
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE='threads(+)'
9 inherit distutils-r1 waf-utils
10
11 DESCRIPTION="Library for audio labelling"
12 HOMEPAGE="https://aubio.org/"
13 SRC_URI="https://aubio.org/pub/${P}.tar.bz2"
14
15 LICENSE="GPL-3"
16 SLOT="0/5"
17 KEYWORDS="amd64 ~ppc ppc64 sparc x86"
18 IUSE="doc double-precision examples ffmpeg fftw jack libav libsamplerate sndfile python test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND="
22         ffmpeg? (
23                 !libav? ( >=media-video/ffmpeg-2.6:0= )
24                 libav? ( >=media-video/libav-9:0= )
25         )
26         fftw? ( sci-libs/fftw:3.0= )
27         jack? ( virtual/jack )
28         libsamplerate? ( media-libs/libsamplerate )
29         python? (
30                 ${PYTHON_DEPS}
31                 || (
32                         dev-python/numpy-python2[${PYTHON_USEDEP}]
33                         dev-python/numpy[${PYTHON_USEDEP}]
34                 )
35         )
36         sndfile? ( media-libs/libsndfile )
37 "
38 DEPEND="${RDEPEND}
39         ${PYTHON_DEPS}
40         app-text/txt2man
41         virtual/pkgconfig
42         doc? ( app-doc/doxygen )
43 "
44 REQUIRED_USE="${PYTHON_REQUIRED_USE}
45         ?? ( double-precision libsamplerate )
46 "
47
48 DOCS=( AUTHORS ChangeLog README.md )
49 PYTHON_SRC_DIR="${S}"
50
51 src_prepare() {
52         default
53         sed -e "s:doxygen:doxygen_disabled:" -i wscript || die
54
55         if ! use test; then
56                 sed -e "/bld.*tests/d" -i wscript || die
57         fi
58 }
59
60 src_configure() {
61         python_setup
62         local mywafconfargs=(
63                 --enable-complex
64                 --docdir="${EPREFIX}"/usr/share/doc/${PF}
65                 $(use_enable double-precision double)
66                 $(use_enable fftw fftw3)
67                 $(use_enable ffmpeg avcodec)
68                 $(use_enable jack)
69                 $(use_enable libsamplerate samplerate)
70                 $(use_enable sndfile)
71         )
72         use double-precision || mywafconfargs+=( $(use_enable fftw fftw3f) )
73
74         waf-utils_src_configure "${mywafconfargs[@]}"
75
76         if use python ; then
77                 cd "${PYTHON_SRC_DIR}" || die
78                 distutils-r1_src_configure
79         fi
80 }
81
82 src_compile() {
83         waf-utils_src_compile --notests
84
85         if use doc; then
86                 cd "${S}"/doc || die
87                 emake dirhtml
88         fi
89
90         if use python ; then
91                 cd "${PYTHON_SRC_DIR}" || die
92                 distutils-r1_src_compile
93         fi
94 }
95
96 src_test() {
97         waf-utils_src_compile --alltests
98
99         if use python ; then
100                 cd "${PYTHON_SRC_DIR}" || die
101                 distutils-r1_src_test
102         fi
103 }
104
105 src_install() {
106         waf-utils_src_install
107
108         if use examples; then
109                 # install dist_noinst_SCRIPTS from Makefile.am
110                 dodoc -r examples
111         fi
112
113         if use python ; then
114                 cd "${PYTHON_SRC_DIR}" || die
115                 DOCS="" distutils-r1_src_install
116                 newdoc python/README.md README.python
117         fi
118
119         if use doc; then
120                 dodoc doc/*.txt
121                 docinto html
122                 dodoc -r doc/_build/dirhtml/.
123         fi
124
125         find "${ED}" -name "*.a" -delete || die
126 }