diff options
author | Jakov Smolić <jsmolic@gentoo.org> | 2022-05-19 18:57:27 +0200 |
---|---|---|
committer | Jakov Smolić <jsmolic@gentoo.org> | 2022-05-20 20:40:47 +0200 |
commit | 4e471ea961079d5afba8f9f09aaf5b67df9a8e91 (patch) | |
tree | 9ec06a95e587a92806628354237937530153ae87 /dev-util/bpftool | |
parent | sys-devel/bmake: drop 20220303 (diff) | |
download | gentoo-4e471ea961079d5afba8f9f09aaf5b67df9a8e91.tar.gz gentoo-4e471ea961079d5afba8f9f09aaf5b67df9a8e91.tar.bz2 gentoo-4e471ea961079d5afba8f9f09aaf5b67df9a8e91.zip |
dev-util/bpftool: add 5.17.7
Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>
Diffstat (limited to 'dev-util/bpftool')
-rw-r--r-- | dev-util/bpftool/Manifest | 1 | ||||
-rw-r--r-- | dev-util/bpftool/bpftool-5.17.7.ebuild | 117 |
2 files changed, 118 insertions, 0 deletions
diff --git a/dev-util/bpftool/Manifest b/dev-util/bpftool/Manifest index ce726ec47e97..a6e30b48c4a1 100644 --- a/dev-util/bpftool/Manifest +++ b/dev-util/bpftool/Manifest @@ -2,3 +2,4 @@ DIST linux-5.16.tar.xz 123114100 BLAKE2B 07a90cc640ff89e1359c06cee8c38abd33e51f9 DIST linux-5.17.tar.xz 128399340 BLAKE2B 82dc4a45cc25c781ac67aa6ed1e4c369544154960f41c4634d47621f381159687a227054976d078524cda28884d395a15f7542fe44ca74ce98ca6ff54a81d6d0 SHA512 89f0a7ca69d20a539d4b612a7028a30a5e98b402e4b6b88516f14237e5da4b626d7929eab8b40fccc90766e8f3bae87e9858a19077ffad20d8204acf18794f5b DIST patch-5.16.15.xz 721632 BLAKE2B 650cc70fd15c2f3ee527589e122c0a60543d6aae918eff51a9136a8187402b1812d6439bfc9a10882c20c444fd5dcdb9570e4f53024ee7f2ecc8e2f17b3f1a25 SHA512 e5dcae0e6ed3ccb9956f2c9848df0dbc93de55dc704214fa248ac73a8b9de3fdd829a9e9cfa2c15f452548e5ac871ad1594d6a622271bf98fbd07ae747f18520 DIST patch-5.17.4.xz 547280 BLAKE2B 453f8ff38a9c6bc69ebb18fe2ea413844e6987b6ff5e0c735f0d047b730349e35731d5a813c3732b330ae9e06e606987952f4d649b3b9b43144710dd296b769f SHA512 9242ce094611d1ee672e782d3eea5910af6c8172fd237afc0a58414106bfc2e7a771d3db91fbf19bcb3cc123ad103c6950951e0c5c5582410a43caec4eb79465 +DIST patch-5.17.7.xz 668120 BLAKE2B ea6a34976496217babeb0668732b9eaf9e29403e691248be0403c2c800822ea3b38d4cda631153608c63eea1d629ddf4686f45c9e985faad25c4a7566bbd11bb SHA512 b471a65070ad927a9ab407a0e177f2f7822ec4a6f8a25aec82a5a56cb20553ce0539f1f276b59dcb4f9d9a2f9da287c639d9c3ae76ef5f4e8f4ba85d215218d2 diff --git a/dev-util/bpftool/bpftool-5.17.7.ebuild b/dev-util/bpftool/bpftool-5.17.7.ebuild new file mode 100644 index 000000000000..d4a6b8926868 --- /dev/null +++ b/dev-util/bpftool/bpftool-5.17.7.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] +} |