1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8} )
8 inherit autotools distutils-r1 git-r3 libtool multilib multilib-minimal
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 )"
16 IUSE="+debug static-libs python +threads utils"
19 python? ( ${PYTHON_DEPS} )
23 python? ( dev-lang/swig )
29 python? ( ${PYTHON_REQUIRED_USE} )
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
58 cd "${S}"/python || die
59 distutils-r1_src_prepare
62 # out-of-source build broken
63 # https://github.com/thom311/libnl/pull/58
67 multilib_src_configure() {
69 $(multilib_native_use_enable utils cli) \
71 $(use_enable static-libs static) \
72 $(use_enable threads) \
73 --disable-silent-rules
76 multilib_src_compile() {
79 if multilib_is_native_abi && use python; then
81 distutils-r1_src_compile
85 multilib_src_install() {
88 if multilib_is_native_abi && use python; then
89 # Unset DOCS= since distutils-r1.eclass interferes
92 distutils-r1_src_install
96 multilib_src_install_all() {
98 find "${D}" -name '*.la' -delete || die