commit:     44beb81954067f67b22dc8d86470fece96a19209
Author:     Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
AuthorDate: Thu Feb 19 18:02:06 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 21 20:39:47 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44beb819

net-libs/xdp-tools: add 1.6.2

Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/98
Merges: https://codeberg.org/gentoo/gentoo/pulls/98
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-libs/xdp-tools/Manifest               |  1 +
 net-libs/xdp-tools/xdp-tools-1.6.2.ebuild | 98 +++++++++++++++++++++++++++++++
 2 files changed, 99 insertions(+)

diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest
index fa697b019937..7dea3f7bf7ac 100644
--- a/net-libs/xdp-tools/Manifest
+++ b/net-libs/xdp-tools/Manifest
@@ -1,2 +1,3 @@
 DIST xdp-tools-1.5.8.tar.gz 358654 BLAKE2B 
600c43bf78a4cd5874deefe125d65e96a84ebcafdb7ddf97efda73857aba85eb94ea324e0f8f62e637bff435358c6d354c5c839d7e0fecd4052b144075eaebea
 SHA512 
e35d91fb947ec867ade292559afa2687d6f2490ddef87c93879db66b9397b298c94018dc4ba9dac1473e460a0225544e56835e9809601d1badbcd13d37ac918b
 DIST xdp-tools-1.6.1.tar.gz 381904 BLAKE2B 
28c4c6c6810647989fb7dff3ef98068fed8373da70374243bcbfcf806001d74ab28ae6dc7818cc7d6602ebefd3300383d4298f2e932bf5c488fd37907664b44b
 SHA512 
b9f7dec6175005e871017839f1ee9ad27ce2649e2364c6ad00479bdcbd60bf8b0332f5b25fb401aa1a6a65346105b7be001781b9a6e744d9481740bfe919a135
+DIST xdp-tools-1.6.2.tar.gz 389284 BLAKE2B 
f5b2706318aaee96a19257bf10dccf605c38e85cf8cf284ae04102a0507060a8fd65b000273eeff0eed6c3649bc8e84037c21da447496e7a10ce9bd45662126e
 SHA512 
dc6c1e43921969e349aabbe2ceb14fd77827c726f62603764562358779462db57cdd8bcc3328c5c65ac765187bc80bcc72f5dcd82189cc001dbc813506dd719c

diff --git a/net-libs/xdp-tools/xdp-tools-1.6.2.ebuild 
b/net-libs/xdp-tools/xdp-tools-1.6.2.ebuild
new file mode 100644
index 000000000000..9fbb58092a68
--- /dev/null
+++ b/net-libs/xdp-tools/xdp-tools-1.6.2.ebuild
@@ -0,0 +1,98 @@
+# Copyright 2021-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic linux-info toolchain-funcs
+
+DESCRIPTION="The libxdp library and various tools for use with XDP"
+HOMEPAGE="https://github.com/xdp-project/xdp-tools";
+SRC_URI="https://github.com/xdp-project/xdp-tools/archive/refs/tags/v${PV}.tar.gz
 -> ${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="+tools"
+
+# tests require root privileges
+RESTRICT+=" test"
+
+DEPEND="
+       dev-libs/libbpf:=
+       net-libs/libpcap
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+       dev-util/bpftool
+       sys-apps/grep[pcre]
+       llvm-core/clang:*[llvm_targets_BPF]
+       sys-devel/m4
+"
+
+# Not prebuilt -- we build them -- but they're not ordinary ELF objects either.
+QA_PREBUILT="usr/lib/bpf/*.o"
+
+MAKEOPTS+=" V=1"
+
+CONFIG_CHECK="~BPF ~BPF_JIT ~BPF_SYSCALL ~HAVE_EBPF_JIT ~XDP_SOCKETS 
~XDP_SOCKETS_DIAG"
+
+src_prepare() {
+       # remove -Werror: #899744
+       sed -i 's/-Werror//g' lib/Makefile lib/defines.mk || die
+       sed -i '/-Werror/d' lib/common.mk lib/libxdp/Makefile \
+               lib/libxdp/tests/Makefile lib/util/Makefile || die
+
+       default
+}
+
+src_configure() {
+       # fix building with LTO: #861587
+       tc-is-lto && append-cflags $(test-flags-CC -ffat-lto-objects)
+
+       # filter LDFLAGS some more: #916591
+       # ld.lld: error: -r and --icf may not be used together
+       filter-ldflags -Wl,--icf*
+
+       export CC="$(tc-getCC)"
+       export PREFIX="${EPREFIX}/usr"
+       export LIBDIR="${PREFIX}/$(get_libdir)"
+       export BPF_OBJECT_DIR="${PREFIX}/lib/bpf"
+       export PRODUCTION=1
+       export DYNAMIC_LIBXDP=1
+       export FORCE_SYSTEM_LIBBPF=1
+
+       default
+}
+
+src_install() {
+       default
+
+       # To remove the scripts/testing files that are installed.
+       rm -r "${ED}/usr/share/xdp-tools" || die
+
+       # We can't control static archive generation yet.
+       rm "${ED}/usr/$(get_libdir)/libxdp.a" || die
+
+       # Only install tools when requested.
+       use tools || { rm "${ED}/usr/sbin"/* || die; }
+
+       # These are ELF objects but BPF ones.
+       dostrip -x /usr/lib/bpf
+}
+
+pkg_postinst() {
+       elog
+       elog "Many BPF utilities need access to a mounted bpffs virtual file 
system."
+       elog "Either mount it manually like this:"
+       elog
+       elog "  mount bpffs /sys/fs/bpf -t bpf -o 
nosuid,nodev,noexec,relatime,mode=700"
+       elog
+       elog "or add the following line to your /etc/fstab to always mount it 
at boot time:"
+       elog
+       elog "  bpffs  /sys/fs/bpf  bpf  nosuid,nodev,noexec,relatime,mode=700  
0 0"
+       elog
+       elog "You can verify that bpffs is mounted with:"
+       elog
+       elog "  mount | grep /sys/fs/bpf"
+       elog
+}

Reply via email to