Gentoo Archives: gentoo-commits

From: "Jakov Smolić" <jsmolic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/bpftool/
Date: Thu, 24 Feb 2022 11:55:21
Message-Id: 1645703702.0f4aefd305e3db75d478aa0c354b2faf96339b02.jsmolic@gentoo
1 commit: 0f4aefd305e3db75d478aa0c354b2faf96339b02
2 Author: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 24 11:54:00 2022 +0000
4 Commit: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 24 11:55:02 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f4aefd3
7
8 dev-util/bpftool: add 5.16.10
9
10 Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>
11
12 dev-util/bpftool/Manifest | 1 +
13 dev-util/bpftool/bpftool-5.16.10.ebuild | 117 ++++++++++++++++++++++++++++++++
14 2 files changed, 118 insertions(+)
15
16 diff --git a/dev-util/bpftool/Manifest b/dev-util/bpftool/Manifest
17 index e45d03f52264..f00ed52bc07d 100644
18 --- a/dev-util/bpftool/Manifest
19 +++ b/dev-util/bpftool/Manifest
20 @@ -1,5 +1,6 @@
21 DIST linux-5.15.tar.xz 121913744 BLAKE2B 3921274b23f7938abdf3ed9334534b4581e13d7484303d3a5280eddb038999aaa8b836666a487472d9c4a219af0f06b9fecccaf348fb5510ab8762f4ef4b7e83 SHA512 d25ad40b5bcd6a4c6042fd0fd84e196e7a58024734c3e9a484fd0d5d54a0c1d87db8a3c784eff55e43b6f021709dc685eb0efa18d2aec327e4f88a79f405705a
22 DIST linux-5.16.tar.xz 123114100 BLAKE2B 07a90cc640ff89e1359c06cee8c38abd33e51f9b9a89833e31a1d2750526fda4a59e8884db3c1ea63df0a37f0d3de6b5a922b014b7313d8abce20d90ac08adcb SHA512 7a257dd576bc8493595ec7d6f3c9cb6e22c772a8b2dbe735d2485c4f5c56e26a08695546e7e0f1f1cd04a533f25e829361958d4da0b98bf0ba8094dd57a85aaf
23 DIST patch-5.15.8.xz 537596 BLAKE2B 0f431804d406c4bbb09c44826fe1018b0bca94018337b73387d44ff3e25e6b90e2ec10cf9935847786e4dac6e1523e8e7daeaedb4f854d20a155bd13b29a0c72 SHA512 ef6d0841033fecba7c4aa25f5249a1e532a0d95f4b7e7048357ff00277d9abc11897f92d05d4a2cb90372da9cec8aa6664ce1058f71a6cae6bc647649787667d
24 +DIST patch-5.16.10.xz 501568 BLAKE2B 9b3b86590d3b86b398c7ee2118df6944fe94dc872141706aca2e886ed7edf33d3e339847985208836f99c40858d1fe1efc6b6ef853854c9edfdb69b49d868798 SHA512 2e9917689f036b5b28ef9bb8d372148ed9dc0dd4460749d0e27aaa871adeb8e67aaeb557f0d891837be2ccb7f64c346e4f52fc23421917409f46d250fc793f53
25 DIST patch-5.16.2.xz 20432 BLAKE2B 9c9f697e4dd0a78a94ac0bd361ec69683c6904d9af02da55c3001394e6a6efcc1fccd5d44747fff6ea47271b7655bd7866d161a90196cecaddde1c630ef5c425 SHA512 50d3c386e391603fbfe86780bbfa69c3a7caa83a7eea6c239af133dde3a7aa4746f4a3f1483589018d5ac27caa7ee69d869f8f64f4b5121ddab52224f5302222
26 DIST patch-5.16.5.xz 401000 BLAKE2B e58ef6f70b283a9d357472e4e9b148ba1038edb2473d299d367f1293c66051ae2b5aad2131df3f5b99052edc6ca885cc0f2140b727cb5277c776a6a0e01012a4 SHA512 8944096f994207522640b4fc7c0be97677ea44924875870f2dc3734e2e9fa3df871821780e7d459348fbe25db1b22cdfca8e852aed11c823ee489a174fb7d9c3
27
28 diff --git a/dev-util/bpftool/bpftool-5.16.10.ebuild b/dev-util/bpftool/bpftool-5.16.10.ebuild
29 new file mode 100644
30 index 000000000000..d4a6b8926868
31 --- /dev/null
32 +++ b/dev-util/bpftool/bpftool-5.16.10.ebuild
33 @@ -0,0 +1,117 @@
34 +# Copyright 2021-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +PYTHON_COMPAT=( python3_{8..10} )
40 +inherit estack linux-info optfeature python-any-r1 toolchain-funcs
41 +
42 +MY_PV="${PV/_/-}"
43 +MY_PV="${MY_PV/-pre/-git}"
44 +
45 +DESCRIPTION="Tool for inspection and simple manipulation of eBPF programs and maps"
46 +HOMEPAGE="https://kernel.org/"
47 +
48 +LINUX_V="${PV:0:1}.x"
49 +LINUX_VER=$(ver_cut 1-2)
50 +LINUX_PATCH=patch-${PV}.xz
51 +SRC_URI="https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_PATCH}"
52 +
53 +LINUX_SOURCES="linux-${LINUX_VER}.tar.xz"
54 +SRC_URI+=" https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}"
55 +
56 +S_K="${WORKDIR}/linux-${LINUX_VER}"
57 +S="${S_K}/tools/bpf/bpftool"
58 +
59 +LICENSE="GPL-2"
60 +SLOT="0"
61 +KEYWORDS="~amd64 ~x86"
62 +IUSE="caps"
63 +
64 +RDEPEND="
65 + sys-libs/binutils-libs:=
66 + sys-libs/zlib:=
67 + virtual/libelf:=
68 + caps? ( sys-libs/libcap:= )
69 +"
70 +DEPEND="
71 + ${RDEPEND}
72 + >=sys-kernel/linux-headers-5.8
73 +"
74 +BDEPEND="
75 + ${LINUX_PATCH+dev-util/patchutils}
76 + ${PYTHON_DEPS}
77 + dev-python/docutils
78 +"
79 +
80 +CONFIG_CHECK="~DEBUG_INFO_BTF"
81 +
82 +# src_unpack and src_prepare are copied from dev-util/perf since
83 +# it's building from the same tarball, please keep it in sync with perf
84 +src_unpack() {
85 + local paths=(
86 + tools/bpf kernel/bpf
87 + tools/{arch,build,include,lib,perf,scripts} {scripts,include,lib} "arch/*/lib"
88 + )
89 +
90 + # We expect the tar implementation to support the -j option (both
91 + # GNU tar and libarchive's tar support that).
92 + echo ">>> Unpacking ${LINUX_SOURCES} (${paths[*]}) to ${PWD}"
93 + tar --wildcards -xpf "${DISTDIR}"/${LINUX_SOURCES} \
94 + "${paths[@]/#/linux-${LINUX_VER}/}" || die
95 +
96 + if [[ -n ${LINUX_PATCH} ]] ; then
97 + eshopts_push -o noglob
98 + ebegin "Filtering partial source patch"
99 + filterdiff -p1 ${paths[@]/#/-i } -z "${DISTDIR}"/${LINUX_PATCH} \
100 + > ${P}.patch
101 + eend $? || die "filterdiff failed"
102 + eshopts_pop
103 + fi
104 +
105 + local a
106 + for a in ${A}; do
107 + [[ ${a} == ${LINUX_SOURCES} ]] && continue
108 + [[ ${a} == ${LINUX_PATCH} ]] && continue
109 + unpack ${a}
110 + done
111 +}
112 +
113 +src_prepare() {
114 + default
115 +
116 + if [[ -n ${LINUX_PATCH} ]] ; then
117 + pushd "${S_K}" >/dev/null || die
118 + eapply "${WORKDIR}"/${P}.patch
119 + popd || die
120 + fi
121 +
122 + # dev-python/docutils installs rst2man.py, not rst2man
123 + sed -i -e 's/rst2man/rst2man.py/g' Documentation/Makefile || die
124 +}
125 +
126 +bpftool_make() {
127 + local arch=$(tc-arch-kernel)
128 + tc-export AR CC LD
129 +
130 + emake V=1 VF=1 \
131 + HOSTCC="$(tc-getBUILD_CC)" HOSTLD="$(tc-getBUILD_LD)" \
132 + EXTRA_CFLAGS="${CFLAGS}" ARCH="${arch}" BPFTOOL_VERSION="${MY_PV}" \
133 + prefix="${EPREFIX}"/usr \
134 + feature-libcap="$(usex caps 1 0)" \
135 + "$@"
136 +}
137 +
138 +src_compile() {
139 + bpftool_make
140 + bpftool_make -C Documentation
141 +}
142 +
143 +src_install() {
144 + bpftool_make DESTDIR="${D}" install
145 + bpftool_make mandir="${ED}"/usr/share/man -C Documentation install
146 +}
147 +
148 +pkg_postinst() {
149 + optfeature "clang-bpf-co-re support" sys-devel/clang[llvm_targets_BPF]
150 +}