diff options
author | Holger Hoffstätte <holger@applied-asynchrony.com> | 2024-07-17 14:46:19 +0200 |
---|---|---|
committer | Jakov Smolić <jsmolic@gentoo.org> | 2024-07-19 21:48:29 +0200 |
commit | 650e68c2211c27d4d9a12b1e750b6ceb2599220a (patch) | |
tree | 71698022a434b86a73f4113cc36f7f4f1daebea0 /dev-util/bpftool | |
parent | dev-util/bpftool: add myself as proxy maintainer (diff) | |
download | gentoo-650e68c2211c27d4d9a12b1e750b6ceb2599220a.tar.gz gentoo-650e68c2211c27d4d9a12b1e750b6ceb2599220a.tar.bz2 gentoo-650e68c2211c27d4d9a12b1e750b6ceb2599220a.zip |
dev-util/bpftool: add 7.5.0 from kernel 6.10, no longer set explicit version
This avoids confusion wrt. bpftool's advertised capabilities via
its --version output. The ebuild will no longer follow the kernel
version.
Closes: https://bugs.gentoo.org/936209
Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Closes: https://github.com/gentoo/gentoo/pull/37591
Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>
Diffstat (limited to 'dev-util/bpftool')
-rw-r--r-- | dev-util/bpftool/Manifest | 2 | ||||
-rw-r--r-- | dev-util/bpftool/bpftool-7.5.0.ebuild | 124 |
2 files changed, 126 insertions, 0 deletions
diff --git a/dev-util/bpftool/Manifest b/dev-util/bpftool/Manifest index 5251daabfba8..5f1c428547bf 100644 --- a/dev-util/bpftool/Manifest +++ b/dev-util/bpftool/Manifest @@ -1,4 +1,6 @@ +DIST linux-6.10.tar.xz 145142812 BLAKE2B bb243ea7493b9d63aa2df2050a3f1ae2b89ee84a20015239cf157e3f4f51c7ac5efedc8a51132b2d7482f9276ac418de6624831c8a3b806130d9c2d2124c539b SHA512 baa2487954044f991d2ae254d77d14a1f0185dd62c9f0fcaff69f586c9f906823017b8db1c4588f27b076dfa3ebb606929fec859f60ea419e7974330b9289cc2 DIST linux-6.8.tar.xz 142502100 BLAKE2B c6f17f816cea16e629f63e9379b98888713f57b2c5173306926471f139a9d612a0c74e119341f8075390e55e203d787d9edeb4ad5a064b18870f6f0f7ffaafb2 SHA512 5c4eb4aa1d3f7d1ea01c0f7ddeadacdece6e144fd4bdfc16b2b925d3e10dc04de3a6db69320b79a96c3560052616f001d2c09e7a1bb4f7b731e2380a7ecce068 DIST linux-6.9.tar.xz 144034416 BLAKE2B 4cf86c3cfe6e6534745d42dfaeca59b17ea1168c4e8b615c80e6d8aac735f11283cd85fa992b440b5d4452917e94b9f08397a64af0be5894e3df23c68892377e SHA512 fed3b4cd1fbfb4d94618587c1934273d2ecc8b6e42a3d586ff8a5f24980be930f2ef803aa2923ca3bfa5e4e619f967f3af315368f24fa76f610b10443624a579 +DIST patch-6.10.xz 6489436 BLAKE2B 96ab8c23a804ae0d3dc5834efa19f9f9d8b4cd1e84d7519670e3e5213af0ef016079d4c0624f45d4163af7b250cb5ab30aec28bb62433d7480ab3d3a11e681b6 SHA512 adbc39835028aa67aa949310c9d44d83c6fddf6a12fbc305960d935bd7e2009e1ff813f2388cd59e59bf64efb2e1df51a6d266594fa12e75074d7346c78bb2eb DIST patch-6.8.2.xz 247244 BLAKE2B a85078230548543c38550a5546689d0b44a54208cdad591ab34e10dec9348ce2f74e45bf85f373b14977d40556067e2e2c17ac4b6791fbb8aaba98feccd3cdac SHA512 a8e32b89f7680670c69c62f356846bb65b57614f979114627a9a2f945d7dc97c921d30197dffa993e5b18e499ba8c7196046ffdf0e721528a5378d1ee65a9ba5 DIST patch-6.9.2.xz 16184 BLAKE2B 8a37e96c253b55b57c86f1654f2ea8bf65af96b1b38213e90032cb918bb8eea992d6ddbfa6a6774a229ab2e2288ab57bdb6cbad6e7e393c123f24850e06847c9 SHA512 a27af24f0caaa5de3811b6db5acc2d72b96df9ebb5c44bad99a949d871fb06c6ffd2be10cfc35b246d430c7be2291701f802aed47eaa8818ad12b8818a60f3ec diff --git a/dev-util/bpftool/bpftool-7.5.0.ebuild b/dev-util/bpftool/bpftool-7.5.0.ebuild new file mode 100644 index 000000000000..1e317304dc31 --- /dev/null +++ b/dev-util/bpftool/bpftool-7.5.0.ebuild @@ -0,0 +1,124 @@ +# Copyright 2021-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) + +inherit estack linux-info optfeature python-any-r1 bash-completion-r1 toolchain-funcs + +DESCRIPTION="Tool for inspection and simple manipulation of eBPF programs and maps" +HOMEPAGE="https://kernel.org/" + +# Use PV to indicate the full kernel version +PV=6.10 +LINUX_V="${PV:0:1}.x" +LINUX_VER=$(ver_cut 1-2) + +LINUX_SOURCES="linux-${LINUX_VER}.tar.xz" +SRC_URI+="https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}" + +LINUX_PATCH=patch-${PV}.xz +SRC_URI+=" https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_PATCH}" + +S_K="${WORKDIR}/linux-${LINUX_VER}" +S="${S_K}/tools/bpf/bpftool" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86" +IUSE="caps +llvm" + +RDEPEND=" + sys-libs/binutils-libs:= + sys-libs/zlib:= + virtual/libelf:= + caps? ( sys-libs/libcap:= ) + llvm? ( sys-devel/llvm:= ) +" +DEPEND=" + ${RDEPEND} + >=sys-kernel/linux-headers-5.8 +" +BDEPEND=" + ${LINUX_PATCH+dev-util/patchutils} + ${PYTHON_DEPS} + app-arch/tar + 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=( + kernel/bpf tools/{arch,bpf,build,include,lib,perf,scripts} + scripts include lib "arch/*/include" "arch/*/lib" "arch/*/tools" + ) + + # We expect the tar implementation to support the -j and --wildcards option + echo ">>> Unpacking ${LINUX_SOURCES} (${paths[*]}) to ${PWD}" + gtar --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 + + # Use rst2man or rst2man.py depending on which one exists (#930076) + type -P rst2man >/dev/null || sed -i -e 's/rst2man/rst2man.py/g' Documentation/Makefile || die + + # remove -Werror (bug 887981) + sed -i -e 's/\-Werror//g' ../../lib/bpf/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}" \ + prefix="${EPREFIX}"/usr \ + bash_compdir="$(get_bashcompdir)" \ + feature-libcap="$(usex caps 1 0)" \ + feature-llvm="$(usex llvm 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] +} |