1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{3,4} )
8 inherit autotools distutils-r1 eutils git-r3 libtool multilib multilib-minimal
10 DESCRIPTION="A collection of libraries providing APIs to netlink protocol based Linux kernel interfaces"
11 HOMEPAGE="http://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
13 https://github.com/thom311/libnl.git
15 LICENSE="LGPL-2.1 utils? ( GPL-2 )"
18 IUSE="static-libs python utils"
20 RDEPEND="python? ( ${PYTHON_DEPS} )
22 !<=app-emulation/emul-linux-x86-baselibs-20140508-r5
23 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
26 python? ( dev-lang/swig )
31 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
35 MULTILIB_WRAPPED_HEADERS=(
36 # we do not install CLI stuff for non-native
37 /usr/include/libnl3/netlink/cli/addr.h
38 /usr/include/libnl3/netlink/cli/class.h
39 /usr/include/libnl3/netlink/cli/cls.h
40 /usr/include/libnl3/netlink/cli/ct.h
41 /usr/include/libnl3/netlink/cli/exp.h
42 /usr/include/libnl3/netlink/cli/link.h
43 /usr/include/libnl3/netlink/cli/neigh.h
44 /usr/include/libnl3/netlink/cli/qdisc.h
45 /usr/include/libnl3/netlink/cli/route.h
46 /usr/include/libnl3/netlink/cli/rule.h
47 /usr/include/libnl3/netlink/cli/tc.h
48 /usr/include/libnl3/netlink/cli/utils.h
52 epatch "${FILESDIR}"/${PN}-1.1-vlan-header.patch
53 epatch "${FILESDIR}"/${PN}-3.2.20-rtnl_tc_get_ops.patch
54 epatch "${FILESDIR}"/${PN}-3.2.20-cache-api.patch
59 cd "${S}"/python || die
60 distutils-r1_src_prepare
63 # out-of-source build broken
64 # https://github.com/thom311/libnl/pull/58
68 multilib_src_configure() {
70 --disable-silent-rules \
71 $(use_enable static-libs static) \
72 $(multilib_native_use_enable utils cli)
75 multilib_src_compile() {
78 if multilib_is_native_abi && use python; then
80 distutils-r1_src_compile
84 multilib_src_install() {
85 emake DESTDIR="${D}" install
87 if multilib_is_native_abi && use python; then
88 # Unset DOCS= since distutils-r1.eclass interferes
91 distutils-r1_src_install
95 multilib_src_install_all() {
97 prune_libtool_files --modules