3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
|
6 |
inherit flag-o-matic
|
|
7 |
|
6 |
8 |
DESCRIPTION="The libxdp library and various tools for use with XDP"
|
7 |
9 |
HOMEPAGE="https://github.com/xdp-project/xdp-tools"
|
8 |
10 |
SRC_URI="https://github.com/xdp-project/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
... | ... | |
10 |
12 |
LICENSE="GPL-2 LGPL-2.1 BSD-2"
|
11 |
13 |
SLOT="0"
|
12 |
14 |
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
|
13 |
|
|
14 |
15 |
IUSE="+tools"
|
15 |
16 |
|
16 |
|
DEPEND="dev-libs/libbpf:=
|
17 |
|
sys-libs/zlib
|
|
17 |
DEPEND="
|
|
18 |
dev-libs/libbpf:=
|
|
19 |
dev-util/bpftool
|
18 |
20 |
net-libs/libpcap
|
19 |
|
virtual/libelf"
|
|
21 |
sys-libs/zlib
|
|
22 |
virtual/libelf
|
|
23 |
"
|
20 |
24 |
RDEPEND="${DEPEND}"
|
21 |
|
BDEPEND=">=sys-devel/clang-10.0.0"
|
|
25 |
BDEPEND="
|
|
26 |
sys-apps/grep[pcre]
|
|
27 |
>=sys-devel/clang-11.0.0
|
|
28 |
"
|
22 |
29 |
|
23 |
30 |
# Not prebuilt -- we build them -- but they're not ordinary ELF objects either.
|
24 |
31 |
QA_PREBUILT="usr/lib/bpf/*.o"
|
25 |
32 |
|
26 |
33 |
MAKEOPTS+=" V=1"
|
27 |
34 |
|
|
35 |
PATCHES=(
|
|
36 |
"${FILESDIR}"/1.3.1-disable-stack-protector.patch
|
|
37 |
"${FILESDIR}"/1.3.1-fix-btf__type_cnt-detection.patch
|
|
38 |
"${FILESDIR}"/1.3.1-no-Werror.patch
|
|
39 |
"${FILESDIR}"/1.3.1-xdpdump-clang.patch
|
|
40 |
"${FILESDIR}"/1.3.1-musl.patch
|
|
41 |
)
|
|
42 |
|
28 |
43 |
src_configure() {
|
|
44 |
export PREFIX="${EPREFIX}/usr"
|
|
45 |
export LIBDIR="${PREFIX}/$(get_libdir)"
|
|
46 |
export BPF_OBJECT_DIR="${PREFIX}/lib/bpf"
|
29 |
47 |
export PRODUCTION=1
|
30 |
48 |
export DYNAMIC_LIBXDP=1
|
31 |
49 |
export FORCE_SYSTEM_LIBBPF=1
|
|
50 |
|
|
51 |
# bug 861587
|
|
52 |
filter-lto
|
|
53 |
|
32 |
54 |
default
|
33 |
55 |
}
|
34 |
56 |
|
|
57 |
src_test() { :; }
|
|
58 |
|
35 |
59 |
src_install() {
|
36 |
|
export PREFIX="${EPREFIX}/usr"
|
37 |
|
export LIBDIR="${PREFIX}/$(get_libdir)"
|
38 |
|
export BPF_OBJECT_DIR="${PREFIX}/lib/bpf"
|
39 |
60 |
default
|
40 |
61 |
|
41 |
62 |
# To remove the scripts/testing files that are installed.
|
... | ... | |
49 |
70 |
dostrip -x /usr/lib/bpf
|
50 |
71 |
}
|
51 |
72 |
|
52 |
|
src_test() { :; }
|
|
73 |
pkg_postinst() {
|
|
74 |
elog
|
|
75 |
elog "Many BPF utilities need access to a mounted bpffs virtual file system."
|
|
76 |
elog "Either mount it manually like this:"
|
|
77 |
elog
|
|
78 |
elog " mount bpffs /sys/fs/bpf -t bpf -o nosuid,nodev,noexec,relatime,mode=700"
|
|
79 |
elog
|
|
80 |
elog "or add the following line to your /etc/fstab to always mount it at boot time:"
|
|
81 |
elog
|
|
82 |
elog " bpffs /sys/fs/bpf bpf nosuid,nodev,noexec,relatime,mode=700 0 0"
|
|
83 |
elog
|
|
84 |
elog "You can verify that bpffs is mounted with:"
|
|
85 |
elog
|
|
86 |
elog " mount | grep /sys/fs/bpf"
|
|
87 |
elog
|
|
88 |
}
|