*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / net-libs / libpsl / libpsl-0.21.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=(python{2_7,3_{6,7}})
6
7 inherit multilib-minimal python-any-r1
8
9 DESCRIPTION="C library for the Public Suffix List"
10 HOMEPAGE="https://github.com/rockdaboot/libpsl"
11 SRC_URI="https://github.com/rockdaboot/${PN}/releases/download/${P}/${P}.tar.gz"
12 LICENSE="MIT"
13 SLOT="0"
14
15 KEYWORDS="alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv s390 sparc x86"
16 IUSE="icu +idn +man"
17
18 RDEPEND="
19         icu? ( !idn? ( dev-libs/icu:=[${MULTILIB_USEDEP}] ) )
20         idn? (
21                 dev-libs/libunistring[${MULTILIB_USEDEP}]
22                 net-dns/libidn2:=[${MULTILIB_USEDEP}]
23         )
24 "
25
26 DEPEND="
27         ${RDEPEND}
28 "
29 BDEPEND="
30         ${PYTHON_DEPS}
31         dev-util/gtk-doc-am
32         sys-devel/gettext
33         virtual/pkgconfig
34         man? ( dev-libs/libxslt )
35 "
36
37 pkg_pretend() {
38         if use icu && use idn ; then
39                 ewarn "\"icu\" and \"idn\" USE flags are enabled."
40                 ewarn "Using \"idn\"."
41         fi
42 }
43
44 multilib_src_configure() {
45         local myeconfargs=(
46                 --disable-asan
47                 --disable-cfi
48                 --disable-ubsan
49                 $(use_enable man)
50         )
51
52         # Prefer idn even if icu is in USE as well
53         if use idn ; then
54                 myeconfargs+=(
55                         --enable-builtin=libidn2
56                         --enable-runtime=libidn2
57                 )
58         elif use icu ; then
59                 myeconfargs+=(
60                         --enable-builtin=libicu
61                         --enable-runtime=libicu
62                 )
63         else
64                 myeconfargs+=( --disable-runtime )
65         fi
66
67         ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
68 }
69
70 multilib_src_install() {
71         default
72
73         find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
74 }