dev-libs/libnl: Sync with Gentoo

It's from Gentoo commit ed468028e725c9580a7b2ee02d6b7b9375f7a0b2.
This commit is contained in:
Krzesimir Nowak 2023-01-25 18:04:20 +01:00
parent 32a79be312
commit f1b57279f5
10 changed files with 77 additions and 331 deletions

View File

@ -1,2 +1 @@
DIST libnl-1.1.4.tar.gz 1174974 BLAKE2B e6466e15db17fe4725674d77c6cdcefac73e51346f6f4378bc3ea8409c1534519cc28f1123c8201e78f6b95254701a2f9591f907b3cc597ac1210fd3f8b832ea SHA512 25e26ddcc16540346ea34815ab6ac094177e5cee2eb3d843c4f8b30cd9d83390a3e87cb46046dc3bd9ae4d21f77e57bb3827c2cfc588eb18afe049921f2030b4 DIST libnl-3.7.0.tar.gz 1000913 BLAKE2B 22c418ea520416d79ee4552ab6bc5ba99239b29e074c840d31b0ec4171a0403ea9d2c1afcbf1b3428564dd371cadd99bc062ae7540e7496f970c4fb98f967e84 SHA512 80fbbc079299c90afd2a5eda62e4d4f98bf4ef23958c3ce5101f4ed4d81d783af733213bb3bab15f218555d8460bc2394898f909f4ac024fc27281faec86a041
DIST libnl-3.5.0.tar.gz 967835 BLAKE2B cf21c1ffa89799b91bf4bddb8833d5af5c62eb1c53a078ee55a2888bd8439e1ae6db8886c9c4f937297962faac6873b4cf5211ee3d1e5354d96b5dc545a6fc2d SHA512 9c94c09bac34297493b3ea482713d7c0865d2839b5042e5c7d1ed008e2402ab63df35a18e272f40b2cce27d0c31dc733fe7e4b2d376e7ca847a2b0d5e90de50c

View File

@ -1,11 +0,0 @@
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -48,7 +48,7 @@
$(OUT_SLIB): ../Makefile.opts $(OBJ)
@echo " LD $(OUT_SLIB)"; \
- $(CC) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc
+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc
@echo " LN $(OUT_SLIB) $(LN1_SLIB)"; \
rm -f $(LN1_SLIB) ; $(LN) -s $(OUT_SLIB) $(LN1_SLIB)
@echo " LN $(LN1_SLIB) $(LN_SLIB)"; \

View File

@ -1,80 +0,0 @@
From: Patrick McHardy <kaber@trash.net>
Date: Fri, 18 Jan 2008 16:55:48 +0000 (+0100)
Subject: [LIBNL]: Add if_vlan.h
X-Git-Url: http://git.kernel.org/?p=libs%2Fnetlink%2Flibnl.git;a=commitdiff_plain;h=e91bb2ffb090955d443e643a25b250bf3d33534a;hp=7f6b7a8eea0334b34d58dec72c66121a76f08958
[LIBNL]: Add if_vlan.h
vlan support needs VLAN_FLAG_REORDER_HDR, which is not available in
older if_vlan.h versions. Add the current version from the kernel.
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
new file mode 100644
index 0000000..068cd7b
--- /dev/null
+++ include/linux/if_vlan.h
@@ -0,0 +1,61 @@
+/*
+ * VLAN An implementation of 802.1Q VLAN tagging.
+ *
+ * Authors: Ben Greear <greearb@candelatech.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef _LINUX_IF_VLAN_H_
+#define _LINUX_IF_VLAN_H_
+
+
+/* VLAN IOCTLs are found in sockios.h */
+
+/* Passed in vlan_ioctl_args structure to determine behaviour. */
+enum vlan_ioctl_cmds {
+ ADD_VLAN_CMD,
+ DEL_VLAN_CMD,
+ SET_VLAN_INGRESS_PRIORITY_CMD,
+ SET_VLAN_EGRESS_PRIORITY_CMD,
+ GET_VLAN_INGRESS_PRIORITY_CMD,
+ GET_VLAN_EGRESS_PRIORITY_CMD,
+ SET_VLAN_NAME_TYPE_CMD,
+ SET_VLAN_FLAG_CMD,
+ GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
+ GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
+};
+
+enum vlan_flags {
+ VLAN_FLAG_REORDER_HDR = 0x1,
+};
+
+enum vlan_name_types {
+ VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
+ VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
+ VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */
+ VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */
+ VLAN_NAME_TYPE_HIGHEST
+};
+
+struct vlan_ioctl_args {
+ int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
+ char device1[24];
+
+ union {
+ char device2[24];
+ int VID;
+ unsigned int skb_priority;
+ unsigned int name_type;
+ unsigned int bind_type;
+ unsigned int flag; /* Matches vlan_dev_info flags */
+ } u;
+
+ short vlan_qos;
+};
+
+#endif /* !(_LINUX_IF_VLAN_H_) */

View File

@ -1,12 +0,0 @@
--- a/include/netlink-local.h
+++ b/include/netlink-local.h
@@ -343,7 +343,9 @@
}
#define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0]))
+#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
#define __init __attribute__ ((constructor))
#define __exit __attribute__ ((destructor))

View File

@ -1,42 +0,0 @@
--- a/python/netlink/route/links/bridge.py
+++ b/python/netlink/route/links/bridge.py
@@ -6,7 +6,7 @@
"""
-from __future__ import absolute_import
+
from ... import core as netlink
from .. import capi as capi
@@ -19,10 +19,10 @@
def bridge_assert_ext_info(self):
if self._has_ext_info == False:
- print """
+ print("""
Please update your kernel to be able to call this method.
Your current kernel bridge version is too old to support this extention.
- """
+ """)
raise RuntimeWarning()
def port_state2str(self, state):
--- a/doc/resolve-asciidoc-refs.py
+++ b/doc/resolve-asciidoc-refs.py
@@ -22,4 +22,4 @@
rc = re.compile('|'.join(map(re.escape, sorted(refs, reverse=True))))
for line in open(sys.argv[1], 'r'):
- print rc.sub(translate, line),
+ print(rc.sub(translate, line), end=' ')
--- a/doc/doxygen-link.py
+++ b/doc/doxygen-link.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from __future__ import print_function
+
import fileinput
import re
import sys

View File

@ -1,61 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit toolchain-funcs
DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
HOMEPAGE="https://www.infradead.org/~tgr/libnl/"
SRC_URI="http://www.infradead.org/~tgr/libnl/files/${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="1.1"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux"
IUSE="doc static-libs"
DEPEND="doc? ( app-doc/doxygen )"
DOCS=( ChangeLog )
PATCHES=(
"${FILESDIR}"/${PN}-1.1-vlan-header.patch
"${FILESDIR}"/${PN}-1.1-flags.patch
"${FILESDIR}"/${PN}-1.1.3-offsetof.patch
)
src_prepare() {
default
sed -i \
-e '/@echo/d' \
Makefile.rules {lib,src,tests}/Makefile || die
sed -i \
-e 's|-g ||g' \
Makefile.opts.in || die
if ! use static-libs; then
sed -i lib/Makefile -e '/OUT_AR/d' || die
fi
rm -f lib/libnl.a || die
}
src_compile() {
emake AR="$(tc-getAR)"
if use doc ; then
cd "${S}/doc" || die
emake gendoc
fi
}
src_install() {
default
if use doc ; then
cd "${S}/doc" || die
docinto html
dodoc -r html/*
fi
}

View File

@ -1,60 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit git-r3 toolchain-funcs
DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
HOMEPAGE="https://www.infradead.org/~tgr/libnl/"
EGIT_REPO_URI="https://github.com/tgraf/libnl-1.1-stable"
LICENSE="LGPL-2.1"
SLOT="1.1"
IUSE="doc static-libs"
BDEPEND="doc? ( app-doc/doxygen )"
DOCS=( ChangeLog )
PATCHES=(
"${FILESDIR}"/${PN}-1.1-vlan-header.patch
"${FILESDIR}"/${PN}-1.1-flags.patch
"${FILESDIR}"/${PN}-1.1.3-offsetof.patch
)
src_prepare() {
default
sed -i \
-e '/@echo/d' \
Makefile.rules {lib,src,tests}/Makefile || die
sed -i \
-e 's|-g ||g' \
Makefile.opts.in || die
if ! use static-libs ; then
sed -i lib/Makefile -e '/OUT_AR/d' || die
fi
rm -f lib/libnl.a || die
}
src_compile() {
emake AR="$(tc-getAR)"
if use doc ; then
cd "${S}/doc" || die
emake gendoc
fi
}
src_install() {
default
if use doc ; then
cd "${S}/doc" || die
docinto html
dodoc -r html/*
fi
}

View File

@ -1,11 +1,12 @@
# Copyright 1999-2021 Gentoo Authors # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=8
PYTHON_COMPAT=( python3_{7,8,9} )
DISTUTILS_OPTIONAL=1 DISTUTILS_OPTIONAL=1
inherit distutils-r1 libtool multilib-minimal DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..10} )
inherit autotools distutils-r1 multilib-minimal
LIBNL_P=${P/_/-} LIBNL_P=${P/_/-}
LIBNL_DIR=${PV/_/} LIBNL_DIR=${PV/_/}
@ -13,28 +14,33 @@ LIBNL_DIR=${LIBNL_DIR//./_}
DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces" DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
HOMEPAGE="https://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl" HOMEPAGE="https://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
SRC_URI="https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz" if [[ ${PV} == 9999 ]] ; then
S="${WORKDIR}/${LIBNL_P}" EGIT_REPO_URI="https://github.com/thom311/libnl"
inherit git-r3
else
SRC_URI="https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
S="${WORKDIR}/${LIBNL_P}"
fi
LICENSE="LGPL-2.1 utils? ( GPL-2 )" LICENSE="LGPL-2.1 utils? ( GPL-2 )"
SLOT="3" SLOT="3"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux" IUSE="+debug python test utils"
IUSE="+debug static-libs python test +threads utils"
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"
RDEPEND="python? ( ${PYTHON_DEPS} )" RDEPEND="python? ( ${PYTHON_DEPS} )"
DEPEND="${RDEPEND}" DEPEND="${RDEPEND}"
BDEPEND=" BDEPEND="${RDEPEND}
${RDEPEND}
python? ( dev-lang/swig )
test? ( dev-libs/check )
sys-devel/bison sys-devel/bison
sys-devel/flex sys-devel/flex
" python? (
${DISTUTILS_DEPS}
dev-lang/swig
)
test? ( dev-libs/check )"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
DOCS=( ChangeLog )
MULTILIB_WRAPPED_HEADERS=( MULTILIB_WRAPPED_HEADERS=(
# we do not install CLI stuff for non-native # we do not install CLI stuff for non-native
/usr/include/libnl3/netlink/cli/addr.h /usr/include/libnl3/netlink/cli/addr.h
@ -43,6 +49,7 @@ MULTILIB_WRAPPED_HEADERS=(
/usr/include/libnl3/netlink/cli/ct.h /usr/include/libnl3/netlink/cli/ct.h
/usr/include/libnl3/netlink/cli/exp.h /usr/include/libnl3/netlink/cli/exp.h
/usr/include/libnl3/netlink/cli/link.h /usr/include/libnl3/netlink/cli/link.h
/usr/include/libnl3/netlink/cli/mdb.h
/usr/include/libnl3/netlink/cli/neigh.h /usr/include/libnl3/netlink/cli/neigh.h
/usr/include/libnl3/netlink/cli/qdisc.h /usr/include/libnl3/netlink/cli/qdisc.h
/usr/include/libnl3/netlink/cli/route.h /usr/include/libnl3/netlink/cli/route.h
@ -54,47 +61,53 @@ MULTILIB_WRAPPED_HEADERS=(
src_prepare() { src_prepare() {
default default
elibtoolize eautoreconf
if use python; then if use python; then
cd "${S}"/python || die pushd "${S}"/python > /dev/null || die
distutils-r1_src_prepare distutils-r1_src_prepare
popd > /dev/null || die
fi fi
# out-of-source build broken
# https://github.com/thom311/libnl/pull/58
multilib_copy_sources
} }
multilib_src_configure() { multilib_src_configure() {
econf \ # bug #884277
export YACC=yacc.bison
ECONF_SOURCE="${S}" econf \
$(multilib_native_use_enable utils cli) \ $(multilib_native_use_enable utils cli) \
$(use_enable debug) \ $(use_enable debug)
$(use_enable static-libs static) \
$(use_enable threads)
} }
multilib_src_compile() { multilib_src_compile() {
default default
if multilib_is_native_abi && use python; then if multilib_is_native_abi && use python ; then
cd python || die pushd python > /dev/null || die
distutils-r1_src_compile distutils-r1_src_compile
popd > /dev/null || die
fi fi
} }
multilib_src_install() { multilib_src_install() {
emake DESTDIR="${D}" install default
if multilib_is_native_abi && use python; then if multilib_is_native_abi && use python ; then
# Unset DOCS= since distutils-r1.eclass interferes # Unset DOCS= since distutils-r1.eclass interferes
local DOCS=() local DOCS=()
cd python || die
pushd python > /dev/null || die
distutils-r1_src_install distutils-r1_src_install
popd > /dev/null || die
fi fi
} }
multilib_src_install_all() { multilib_src_install_all() {
DOCS=( ChangeLog )
einstalldocs einstalldocs
find "${ED}" -name '*.la' -delete || die find "${ED}" -name '*.la' -delete || die
} }

View File

@ -1,35 +1,46 @@
# Copyright 1999-2021 Gentoo Authors # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=7 EAPI=8
PYTHON_COMPAT=( python3_{7,8,9} )
DISTUTILS_OPTIONAL=1 DISTUTILS_OPTIONAL=1
inherit autotools distutils-r1 git-r3 multilib-minimal DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{9..10} )
inherit autotools distutils-r1 multilib-minimal
LIBNL_P=${P/_/-}
LIBNL_DIR=${PV/_/}
LIBNL_DIR=${LIBNL_DIR//./_}
DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces" DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel interfaces"
HOMEPAGE="https://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl" HOMEPAGE="https://www.infradead.org/~tgr/libnl/ https://github.com/thom311/libnl"
EGIT_REPO_URI="https://github.com/thom311/libnl" if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://github.com/thom311/libnl"
inherit git-r3
else
SRC_URI="https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
S="${WORKDIR}/${LIBNL_P}"
fi
LICENSE="LGPL-2.1 utils? ( GPL-2 )" LICENSE="LGPL-2.1 utils? ( GPL-2 )"
SLOT="3" SLOT="3"
KEYWORDS="" IUSE="+debug python test utils"
IUSE="+debug static-libs python test +threads utils"
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"
RDEPEND="python? ( ${PYTHON_DEPS} )" RDEPEND="python? ( ${PYTHON_DEPS} )"
DEPEND="${RDEPEND}" DEPEND="${RDEPEND}"
BDEPEND=" BDEPEND="${RDEPEND}
${RDEPEND}
sys-devel/bison sys-devel/bison
sys-devel/flex sys-devel/flex
python? ( dev-lang/swig ) python? (
test? ( dev-libs/check ) ${DISTUTILS_DEPS}
" dev-lang/swig
)
test? ( dev-libs/check )"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
DOCS=( ChangeLog )
MULTILIB_WRAPPED_HEADERS=( MULTILIB_WRAPPED_HEADERS=(
# we do not install CLI stuff for non-native # we do not install CLI stuff for non-native
/usr/include/libnl3/netlink/cli/addr.h /usr/include/libnl3/netlink/cli/addr.h
@ -38,6 +49,7 @@ MULTILIB_WRAPPED_HEADERS=(
/usr/include/libnl3/netlink/cli/ct.h /usr/include/libnl3/netlink/cli/ct.h
/usr/include/libnl3/netlink/cli/exp.h /usr/include/libnl3/netlink/cli/exp.h
/usr/include/libnl3/netlink/cli/link.h /usr/include/libnl3/netlink/cli/link.h
/usr/include/libnl3/netlink/cli/mdb.h
/usr/include/libnl3/netlink/cli/neigh.h /usr/include/libnl3/netlink/cli/neigh.h
/usr/include/libnl3/netlink/cli/qdisc.h /usr/include/libnl3/netlink/cli/qdisc.h
/usr/include/libnl3/netlink/cli/route.h /usr/include/libnl3/netlink/cli/route.h
@ -46,10 +58,6 @@ MULTILIB_WRAPPED_HEADERS=(
/usr/include/libnl3/netlink/cli/utils.h /usr/include/libnl3/netlink/cli/utils.h
) )
PATCHES=(
"${FILESDIR}"/${PN}-99999999-2to3.patch
)
src_prepare() { src_prepare() {
default default
@ -60,25 +68,18 @@ src_prepare() {
distutils-r1_src_prepare distutils-r1_src_prepare
popd > /dev/null || die popd > /dev/null || die
fi fi
# out-of-source build broken
# https://github.com/thom311/libnl/pull/58
multilib_copy_sources
} }
multilib_src_configure() { multilib_src_configure() {
econf \ ECONF_SOURCE="${S}" econf \
$(multilib_native_use_enable utils cli) \ $(multilib_native_use_enable utils cli) \
$(use_enable debug) \ $(use_enable debug)
$(use_enable static-libs static) \
$(use_enable threads) \
--disable-doc
} }
multilib_src_compile() { multilib_src_compile() {
default default
if multilib_is_native_abi && use python; then if multilib_is_native_abi && use python ; then
pushd python > /dev/null || die pushd python > /dev/null || die
distutils-r1_src_compile distutils-r1_src_compile
popd > /dev/null || die popd > /dev/null || die
@ -88,7 +89,7 @@ multilib_src_compile() {
multilib_src_install() { multilib_src_install() {
default default
if multilib_is_native_abi && use python; then if multilib_is_native_abi && use python ; then
# Unset DOCS= since distutils-r1.eclass interferes # Unset DOCS= since distutils-r1.eclass interferes
local DOCS=() local DOCS=()
@ -96,14 +97,14 @@ multilib_src_install() {
distutils-r1_src_install distutils-r1_src_install
# For no obvious reason this is not done automatically
python_foreach_impl python_optimize
popd > /dev/null || die popd > /dev/null || die
fi fi
} }
multilib_src_install_all() { multilib_src_install_all() {
DOCS=( ChangeLog )
einstalldocs einstalldocs
find "${ED}" -name '*.la' -delete || die find "${ED}" -name '*.la' -delete || die
} }

View File

@ -6,7 +6,6 @@
<name>Gentoo network monitoring and analysis project</name> <name>Gentoo network monitoring and analysis project</name>
</maintainer> </maintainer>
<use> <use>
<flag name="doc">Install development documentation</flag>
<flag name="python">Install experimental <pkg>dev-lang/python</pkg> bindings</flag> <flag name="python">Install experimental <pkg>dev-lang/python</pkg> bindings</flag>
<flag name="utils">Install command line interface utils</flag> <flag name="utils">Install command line interface utils</flag>
</use> </use>