sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / media-libs / aubio / aubio-0.4.9.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=( python3_{6,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 libsamplerate sndfile python test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND="
22         ffmpeg? ( >=media-video/ffmpeg-2.6:0= )
23         fftw? ( sci-libs/fftw:3.0= )
24         jack? ( virtual/jack )
25         libsamplerate? ( media-libs/libsamplerate )
26         python? (
27                 ${PYTHON_DEPS}
28                 dev-python/numpy[${PYTHON_USEDEP}]
29         )
30         sndfile? ( media-libs/libsndfile )
31 "
32 DEPEND="${RDEPEND}
33         ${PYTHON_DEPS}
34         app-text/txt2man
35         virtual/pkgconfig
36         doc? ( app-doc/doxygen )
37 "
38 REQUIRED_USE="${PYTHON_REQUIRED_USE}
39         ?? ( double-precision libsamplerate )
40 "
41
42 DOCS=( AUTHORS ChangeLog README.md )
43 PYTHON_SRC_DIR="${S}"
44
45 PATCHES=(
46         "${FILESDIR}"/${PN}-0.4.9-docdir.patch
47 )
48
49 src_prepare() {
50         default
51         sed -e "s:doxygen:doxygen_disabled:" -i wscript || die
52
53         if ! use test; then
54                 sed -e "/bld.*tests/d" -i wscript || die
55         fi
56 }
57
58 src_configure() {
59         python_setup
60         local mywafconfargs=(
61                 --enable-complex
62                 --docdir="${EPREFIX}"/usr/share/doc/${PF}
63                 $(use_enable doc docs)
64                 $(use_enable double-precision double)
65                 $(use_enable fftw fftw3)
66                 $(use_enable ffmpeg avcodec)
67                 $(use_enable jack)
68                 $(use_enable libsamplerate samplerate)
69                 $(use_enable sndfile)
70         )
71         use double-precision || mywafconfargs+=( $(use_enable fftw fftw3f) )
72
73         waf-utils_src_configure "${mywafconfargs[@]}"
74
75         if use python ; then
76                 cd "${PYTHON_SRC_DIR}" || die
77                 distutils-r1_src_configure
78         fi
79 }
80
81 src_compile() {
82         waf-utils_src_compile --notests
83
84         if use doc; then
85                 cd "${S}"/doc || die
86                 emake dirhtml
87         fi
88
89         if use python ; then
90                 cd "${PYTHON_SRC_DIR}" || die
91                 distutils-r1_src_compile
92         fi
93 }
94
95 src_test() {
96         waf-utils_src_compile --alltests
97
98         if use python ; then
99                 cd "${PYTHON_SRC_DIR}" || die
100                 distutils-r1_src_test
101         fi
102 }
103
104 src_install() {
105         waf-utils_src_install
106
107         if use examples; then
108                 # install dist_noinst_SCRIPTS from Makefile.am
109                 dodoc -r examples
110         fi
111
112         if use python ; then
113                 cd "${PYTHON_SRC_DIR}" || die
114                 DOCS="" distutils-r1_src_install
115                 newdoc python/README.md README.python
116         fi
117
118         if use doc; then
119                 dodoc doc/*.txt
120                 docinto html
121                 dodoc -r doc/_build/dirhtml/.
122         fi
123
124         find "${ED}" -name "*.a" -delete || die
125 }