-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98eb4de
commit c12f984
Showing
3 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
DIST xdp-tools-1.4.3.tar.gz 339989 BLAKE2B 836eb66a2264e9d46124a009a8b3e039da23f28f83460fb3aa724c8ca4c37952979278e3041e9acca44acd68cc94423d73f381febc107c454db7da01f583ae41 SHA512 3ba176e573d02feefc1baf81570b514bc25a61d7be3256ce530128092f07b246b8731430289cdcd874f8846122a4451f0bcd06891565dd1b48beaa10b854c646 | ||
EBUILD xdp-tools-1.4.3.ebuild 2286 BLAKE2B f628edd88fd0dc18f02e46bc5e2fa7bfb11ea6483f6d6d14a11fd7e0be0c97032902a4a3eaa9b57b85fc784ff15a16335d48f35c92fa338e4dbf3f2a38c4f74a SHA512 b26960a9d91d9997aaa4c7c7f5817e5709ca4636f25aa03ed5f7f804640d81b4a62af8a7693d46a967c5d35227763d2f87dfb2c73d5725d4d589c7d3f2f09989 | ||
MISC metadata.xml 731 BLAKE2B a9c958d31f9ece376e4518e213823c14474df47747205020b76da7a0a67f7ed926ec55002b586143ce84cb965a23ad1794a42862597278682ef3605fc7d07911 SHA512 78774e4bcc6e05d56fe82b0aacd46e4d23e3bd89aa5bb55900adb94648d06b3251c575d4d0b6108cdad0f2ffbabcc2973e50e804b120a73e8923cd679601384f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> | ||
<pkgmetadata> | ||
<maintainer type="person" proxied="yes"> | ||
<email>[email protected]</email> | ||
<name>Holger Hoffstätte</name> | ||
</maintainer> | ||
<maintainer type="project" proxied="proxy"> | ||
<email>[email protected]</email> | ||
<name>Proxy Maintainers</name> | ||
</maintainer> | ||
<maintainer type="person"> | ||
<email>[email protected]</email> | ||
<name>Jason A. Donenfeld</name> | ||
</maintainer> | ||
<upstream> | ||
<remote-id type="github">xdp-project/xdp-tools</remote-id> | ||
</upstream> | ||
<use> | ||
<flag name="tools">Install various helper tools rather than just libxdp.</flag> | ||
</use> | ||
</pkgmetadata> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Copyright 2021-2024 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
inherit flag-o-matic 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/${PN}/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" | ||
|
||
DEPEND=" | ||
dev-libs/libbpf:= | ||
dev-util/bpftool | ||
net-libs/libpcap | ||
sys-libs/zlib | ||
virtual/libelf | ||
" | ||
RDEPEND="${DEPEND}" | ||
BDEPEND=" | ||
sys-apps/grep[pcre] | ||
>=sys-devel/clang-11.0.0 | ||
" | ||
|
||
# Not prebuilt -- we build them -- but they're not ordinary ELF objects either. | ||
QA_PREBUILT="usr/lib/bpf/*.o" | ||
|
||
MAKEOPTS+=" V=1" | ||
|
||
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() { | ||
# filter LTO: #861587 | ||
filter-lto | ||
|
||
# filter LDFLAGS some more: #916591 | ||
filter-ldflags -Wl,--{icf,lto}* | ||
|
||
# force ld.bfd: #916591 | ||
tc-ld-force-bfd | ||
|
||
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_test() { :; } | ||
|
||
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 | ||
|
||
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 | ||
} |