*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-libs / libnl / libnl-99999999.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=( python2_7 python3_{6,7,8} )
7 DISTUTILS_OPTIONAL=1
8 inherit autotools distutils-r1 git-r3 libtool multilib multilib-minimal
9
10 DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
11 HOMEPAGE="http://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
12 EGIT_REPO_URI="https://github.com/thom311/libnl"
13 LICENSE="LGPL-2.1 utils? ( GPL-2 )"
14 SLOT="3"
15 KEYWORDS=""
16 IUSE="+debug static-libs python +threads utils"
17
18 RDEPEND="
19         python? ( ${PYTHON_DEPS} )
20 "
21 DEPEND="
22         ${RDEPEND}
23         python? ( dev-lang/swig )
24         sys-devel/bison
25         sys-devel/flex
26 "
27
28 REQUIRED_USE="
29         python? ( ${PYTHON_REQUIRED_USE} )
30 "
31
32 DOCS=(
33         ChangeLog
34 )
35
36 MULTILIB_WRAPPED_HEADERS=(
37         # we do not install CLI stuff for non-native
38         /usr/include/libnl3/netlink/cli/addr.h
39         /usr/include/libnl3/netlink/cli/class.h
40         /usr/include/libnl3/netlink/cli/cls.h
41         /usr/include/libnl3/netlink/cli/ct.h
42         /usr/include/libnl3/netlink/cli/exp.h
43         /usr/include/libnl3/netlink/cli/link.h
44         /usr/include/libnl3/netlink/cli/neigh.h
45         /usr/include/libnl3/netlink/cli/qdisc.h
46         /usr/include/libnl3/netlink/cli/route.h
47         /usr/include/libnl3/netlink/cli/rule.h
48         /usr/include/libnl3/netlink/cli/tc.h
49         /usr/include/libnl3/netlink/cli/utils.h
50 )
51
52 src_prepare() {
53         default
54
55         eautoreconf
56
57         if use python; then
58                 cd "${S}"/python || die
59                 distutils-r1_src_prepare
60         fi
61
62         # out-of-source build broken
63         # https://github.com/thom311/libnl/pull/58
64         multilib_copy_sources
65 }
66
67 multilib_src_configure() {
68         econf \
69                 $(multilib_native_use_enable utils cli) \
70                 $(use_enable debug) \
71                 $(use_enable static-libs static) \
72                 $(use_enable threads) \
73                 --disable-silent-rules
74 }
75
76 multilib_src_compile() {
77         default
78
79         if multilib_is_native_abi && use python; then
80                 cd python || die
81                 distutils-r1_src_compile
82         fi
83 }
84
85 multilib_src_install() {
86         default
87
88         if multilib_is_native_abi && use python; then
89                 # Unset DOCS= since distutils-r1.eclass interferes
90                 local DOCS=()
91                 cd python || die
92                 distutils-r1_src_install
93         fi
94 }
95
96 multilib_src_install_all() {
97         einstalldocs
98         find "${D}" -name '*.la' -delete || die
99 }