*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / media-libs / libsndfile / libsndfile-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python{2_7,3_6,3_7} pypy3 )
7
8 if [[ ${PV} == *9999 ]]; then
9         inherit autotools git-r3
10         EGIT_REPO_URI="https://github.com/erikd/libsndfile.git"
11 else
12         SRC_URI="http://www.mega-nerd.com/libsndfile/files/${P}.tar.gz"
13         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
14 fi
15 inherit python-any-r1 multilib-minimal
16
17 DESCRIPTION="C library for reading and writing files containing sampled sound"
18 HOMEPAGE="http://www.mega-nerd.com/libsndfile"
19
20 LICENSE="LGPL-2.1"
21 SLOT="0"
22 IUSE="alsa minimal sqlite static-libs test"
23 RESTRICT="!test? ( test )"
24
25 RDEPEND="
26         !minimal? (
27                 >=media-libs/flac-1.2.1-r5:=[${MULTILIB_USEDEP}]
28                 >=media-libs/libogg-1.3.0:=[${MULTILIB_USEDEP}]
29                 >=media-libs/libvorbis-1.3.3-r1:=[${MULTILIB_USEDEP}]
30                 >=media-libs/opus-1.1:=[${MULTILIB_USEDEP}]
31         )
32         alsa? ( media-libs/alsa-lib:= )
33         sqlite? ( >=dev-db/sqlite-3.2 )"
34 DEPEND="${RDEPEND}"
35 BDEPEND="
36         virtual/pkgconfig
37         test? ( ${PYTHON_DEPS} )"
38 if [[ ${PV} == *9999 ]]; then
39         BDEPEND+="
40                 ${PYTHON_DEPS}
41                 sys-devel/autogen
42         "
43 fi
44
45 pkg_setup() {
46         if use test || [[ ${PV} == *9999 ]]; then
47                 python-any-r1_pkg_setup
48         fi
49 }
50
51 src_prepare() {
52         default
53
54         [[ ${PV} == *9999 ]] && eautoreconf
55 }
56
57 multilib_src_configure() {
58         ECONF_SOURCE="${S}" econf \
59                 --disable-octave \
60                 $(use_enable static-libs static) \
61                 $(use_enable !minimal external-libs) \
62                 $(multilib_native_enable full-suite) \
63                 $(multilib_native_use_enable alsa) \
64                 $(multilib_native_use_enable sqlite) \
65                 PYTHON="${EPYTHON}"
66 }
67
68 multilib_src_install_all() {
69         einstalldocs
70
71         # package provides .pc files
72         find "${D}" -name '*.la' -delete || die
73 }