summaryrefslogtreecommitdiff
path: root/dev-util/bpftool
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-01-07 22:48:01 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-01-07 22:48:01 +0000
commitc3bc61051d7f12b4c682efa7a5460bbc8815649e (patch)
treeb6d19e96ba3c397fb8278eeb9b68170db92630ba /dev-util/bpftool
parent3517852e3b8a68d1e997770fc0650c5053bafc6c (diff)
gentoo resync : 07.01.2022
Diffstat (limited to 'dev-util/bpftool')
-rw-r--r--dev-util/bpftool/Manifest2
-rw-r--r--dev-util/bpftool/bpftool-5.15.12.ebuild117
2 files changed, 119 insertions, 0 deletions
diff --git a/dev-util/bpftool/Manifest b/dev-util/bpftool/Manifest
index 738844c6b65b..3308d1674a74 100644
--- a/dev-util/bpftool/Manifest
+++ b/dev-util/bpftool/Manifest
@@ -1,7 +1,9 @@
DIST linux-5.14.tar.xz 120669872 BLAKE2B 0047f5aaa3940dff97f4055ef544faafbbb5282128e6afe21d2f47d8dc8c395806a17016febfa050117d16f59e74b882cb8b9c5011d68f119c230d0a4d120524 SHA512 8e4f3ec3d36f774280f75dc7b004a43e09417af58f12e9c9f8348976659d4cfda7ad905f306f43fed66a27922e5c45db22e46bbfa7a0b9f365012380de3b6f64
DIST linux-5.15.tar.xz 121913744 BLAKE2B 3921274b23f7938abdf3ed9334534b4581e13d7484303d3a5280eddb038999aaa8b836666a487472d9c4a219af0f06b9fecccaf348fb5510ab8762f4ef4b7e83 SHA512 d25ad40b5bcd6a4c6042fd0fd84e196e7a58024734c3e9a484fd0d5d54a0c1d87db8a3c784eff55e43b6f021709dc685eb0efa18d2aec327e4f88a79f405705a
DIST patch-5.14.14.xz 528644 BLAKE2B 3917c340eb1cd814b7fd40420e32baa84c6a062a7c52ab75301cfce8e59acf055f3c9ff38f4ae1590837f245607e294277001f0a0b53ee44b0056b83f98bc68f SHA512 258fa67ee6e6d13b4e92d361898313b4e2f3d9d0be883e5c5a0c436e51cf8bcb3eb5acb46272bb5df2bbf8390b81152e8244b1d6faf7299314589b90c95eebba
+DIST patch-5.15.12.xz 620100 BLAKE2B 8ac09e5cff7465641818e24e846a014bc936e2e2f61b7d1973319d5665d45acd6be24d28430173b5646e80cf67351044165b949575baf76ccdfb46ae34fc1468 SHA512 0e2dbfa675f00ddcb72369d1aed76470ed37a0968856e00d620bdc4bc7891a1646b4f9dcf864a57c26a5b9ab6afec43c8a62ad5c7e0549aaf0e8bae2852a752b
DIST patch-5.15.8.xz 537596 BLAKE2B 0f431804d406c4bbb09c44826fe1018b0bca94018337b73387d44ff3e25e6b90e2ec10cf9935847786e4dac6e1523e8e7daeaedb4f854d20a155bd13b29a0c72 SHA512 ef6d0841033fecba7c4aa25f5249a1e532a0d95f4b7e7048357ff00277d9abc11897f92d05d4a2cb90372da9cec8aa6664ce1058f71a6cae6bc647649787667d
EBUILD bpftool-5.14.14.ebuild 2825 BLAKE2B ddddd1db68cd7ebce4872227c8896ef0f81a85b46230c7e4ef83e08cc3a004f46df67815812a2f80d8ec56e65e0bb794b56fc32f8c5ee70ed8d9ed52add95aae SHA512 b67729b68efd059799b8dcc8146bfdb6ea8e92482fcc2f960d7e3bcf7a2002409f1423f13ef2c18b31bacdf86a7c5eee322d563540dfa03752a0ccbb7458c9f9
+EBUILD bpftool-5.15.12.ebuild 2831 BLAKE2B de315e53f165a2008a74021dbf4ccfeab5a59121e1044dd5b11d3df29c086c38ce32a40ab7d1fb2aa16ed7c1cbf4208a7ca1252fef3eb48716cd0b74d6c64684 SHA512 87b2a927a3b3b2738f0a2f126af9d83bbd68b7200c4b36b987e898d65c3508018636413cfb113715065514b7ccf251a0b8903597249ce8ed116c4ae881a3880e
EBUILD bpftool-5.15.8.ebuild 2826 BLAKE2B 75caba7a4cb73dba40a6e3c08751327e97f32f618d7240b694434371ba63722626565fcf9fe6ffe0961929e1f6736bf80cda3c196c3aa6160404521ea20628fa SHA512 5c02dcd3f55e406955fbbdb4199ff89572665a1c09f443217e415e0a0b19df8865d7a75342ce3305e93254066f4f49670ad34b879aacd1d68a36fcd0db696829
MISC metadata.xml 356 BLAKE2B 4cc2dafd4a125f2144fc8537377c1857c4cf3ace56242965c41f29b5601b346b211ae8a05459b555569b4a11d2eed39345f02c3fe27ba8a8f93117969ee8b8cc SHA512 c2c0f149fbec22400163df406cdc10df537bef638251eeabc332709992e7470c323b366cfc465d6ecf14f2d84065660cccefef7a5ca45980d679b645ebf664be
diff --git a/dev-util/bpftool/bpftool-5.15.12.ebuild b/dev-util/bpftool/bpftool-5.15.12.ebuild
new file mode 100644
index 000000000000..d4a6b8926868
--- /dev/null
+++ b/dev-util/bpftool/bpftool-5.15.12.ebuild
@@ -0,0 +1,117 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit estack linux-info optfeature python-any-r1 toolchain-funcs
+
+MY_PV="${PV/_/-}"
+MY_PV="${MY_PV/-pre/-git}"
+
+DESCRIPTION="Tool for inspection and simple manipulation of eBPF programs and maps"
+HOMEPAGE="https://kernel.org/"
+
+LINUX_V="${PV:0:1}.x"
+LINUX_VER=$(ver_cut 1-2)
+LINUX_PATCH=patch-${PV}.xz
+SRC_URI="https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_PATCH}"
+
+LINUX_SOURCES="linux-${LINUX_VER}.tar.xz"
+SRC_URI+=" https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}"
+
+S_K="${WORKDIR}/linux-${LINUX_VER}"
+S="${S_K}/tools/bpf/bpftool"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="caps"
+
+RDEPEND="
+ sys-libs/binutils-libs:=
+ sys-libs/zlib:=
+ virtual/libelf:=
+ caps? ( sys-libs/libcap:= )
+"
+DEPEND="
+ ${RDEPEND}
+ >=sys-kernel/linux-headers-5.8
+"
+BDEPEND="
+ ${LINUX_PATCH+dev-util/patchutils}
+ ${PYTHON_DEPS}
+ dev-python/docutils
+"
+
+CONFIG_CHECK="~DEBUG_INFO_BTF"
+
+# src_unpack and src_prepare are copied from dev-util/perf since
+# it's building from the same tarball, please keep it in sync with perf
+src_unpack() {
+ local paths=(
+ tools/bpf kernel/bpf
+ tools/{arch,build,include,lib,perf,scripts} {scripts,include,lib} "arch/*/lib"
+ )
+
+ # We expect the tar implementation to support the -j option (both
+ # GNU tar and libarchive's tar support that).
+ echo ">>> Unpacking ${LINUX_SOURCES} (${paths[*]}) to ${PWD}"
+ tar --wildcards -xpf "${DISTDIR}"/${LINUX_SOURCES} \
+ "${paths[@]/#/linux-${LINUX_VER}/}" || die
+
+ if [[ -n ${LINUX_PATCH} ]] ; then
+ eshopts_push -o noglob
+ ebegin "Filtering partial source patch"
+ filterdiff -p1 ${paths[@]/#/-i } -z "${DISTDIR}"/${LINUX_PATCH} \
+ > ${P}.patch
+ eend $? || die "filterdiff failed"
+ eshopts_pop
+ fi
+
+ local a
+ for a in ${A}; do
+ [[ ${a} == ${LINUX_SOURCES} ]] && continue
+ [[ ${a} == ${LINUX_PATCH} ]] && continue
+ unpack ${a}
+ done
+}
+
+src_prepare() {
+ default
+
+ if [[ -n ${LINUX_PATCH} ]] ; then
+ pushd "${S_K}" >/dev/null || die
+ eapply "${WORKDIR}"/${P}.patch
+ popd || die
+ fi
+
+ # dev-python/docutils installs rst2man.py, not rst2man
+ sed -i -e 's/rst2man/rst2man.py/g' Documentation/Makefile || die
+}
+
+bpftool_make() {
+ local arch=$(tc-arch-kernel)
+ tc-export AR CC LD
+
+ emake V=1 VF=1 \
+ HOSTCC="$(tc-getBUILD_CC)" HOSTLD="$(tc-getBUILD_LD)" \
+ EXTRA_CFLAGS="${CFLAGS}" ARCH="${arch}" BPFTOOL_VERSION="${MY_PV}" \
+ prefix="${EPREFIX}"/usr \
+ feature-libcap="$(usex caps 1 0)" \
+ "$@"
+}
+
+src_compile() {
+ bpftool_make
+ bpftool_make -C Documentation
+}
+
+src_install() {
+ bpftool_make DESTDIR="${D}" install
+ bpftool_make mandir="${ED}"/usr/share/man -C Documentation install
+}
+
+pkg_postinst() {
+ optfeature "clang-bpf-co-re support" sys-devel/clang[llvm_targets_BPF]
+}