summaryrefslogtreecommitdiff
path: root/dev-util/bpftool
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/bpftool')
-rw-r--r--dev-util/bpftool/Manifest3
-rw-r--r--dev-util/bpftool/bpftool-6.1.7.ebuild123
2 files changed, 126 insertions, 0 deletions
diff --git a/dev-util/bpftool/Manifest b/dev-util/bpftool/Manifest
index 1b6f9a849373..0415ec3a671e 100644
--- a/dev-util/bpftool/Manifest
+++ b/dev-util/bpftool/Manifest
@@ -1,9 +1,12 @@
AUX 5.19.12-no-stack-protector.patch 517 BLAKE2B 5d47108db32a2c33a0151997c26da2d1f9944b4796e6b0e4c90a8dc8edfc0a0cfc78be248dd484e1b55038f64e226633e9b7d792bed980b875d9d628e04ee376 SHA512 155cf0d515b9c644fcfe233c0f2a05b2b6ffecfc634f0320b32e3dcbfcf7807896bc2d09a70f139af62d9c743c1fcdafade890dcedd73bb240f38b55b1ee6a2a
DIST linux-5.19.tar.xz 131581464 BLAKE2B 4db03a6830a3b3bbf0837e1912182a443d9a4aa8af20a12e6ec814ed708038452d3c0ccee1258cca671c464d76461536363a8adc56e9d098c9a44ae3484a297a SHA512 00313b2f9b82d2dc3fb8294007cf7d7599d254b717ed2de23c81fa7a1bbcbc2798ad286cb94e2f7f5bd54132d1d764facd90d30f79dbcc6616cc7f926adc2623
DIST linux-6.0.tar.xz 133886176 BLAKE2B c09a9c877ac0fac83dc31d2d04d96f0a3331d4ed78e3ad4edfd4dc077e1c11d0c49f419fdac4008b5c93d1b09c2b724e12ef0b38371ad0962908abf85dfa95fa SHA512 bac41a7aeb6e809616cee2f13dcd1c45e829dfd1ccf60aee1dc4c46b1e28532f4485c7d819a32940de84fdfbf89db80a4e919bce8a74b2948c5a01551771b714
+DIST linux-6.1.tar.xz 134728520 BLAKE2B ae60257860b2bd1bd708d183f0443afc60ebbd2b3d535c45e44c2e541bd0928530a3b62de6385dd4e4726ebbedcc0a871d4f3ffb4105b9f1f6d8ed7467f5688e SHA512 6ed2a73c2699d0810e54753715635736fc370288ad5ce95c594f2379959b0e418665cd71bc512a0273fe226fe90074d8b10d14c209080a6466498417a4fdda68
DIST patch-5.19.12.xz 828424 BLAKE2B fa5c2a42443179dd36ee62b6b14415b261ff528296d8cf6c335012baf1408ab8b981236b247da2f8d0a68ecef5e8bc65b6e77bd8800ef1962b258fdf3f692ac1 SHA512 40ec4228cfac91607a645971ebd85e8b85d20c4d93d5fbe3fbecf87d51958c44ff218f931a1bd8f80157e66d3c956a5391cd9aef027098003b6724a6bc49b8bc
DIST patch-6.0.12.xz 635356 BLAKE2B f7407d0f95ee70e7cbb80139e61b68d2da5467a95a3d4a3c9c434616f2c6420beea483b115c60ce645d4ba586188d8beb8a82ddb32de09816d6773ba89bc21aa SHA512 d604975d02735d6ba8f98268d418397d78bf49d129aabd326599196708bf05795b17d22398ddd0229bc2944f7b152902e9638ff9aa04977c46a229566894dd00
+DIST patch-6.1.7.xz 533812 BLAKE2B b08005dfaa1247378fa2b3d1955537bcbbc6ee8c9171552e27ce51716c4c414e6b442d6ee33344431275e6b0140f315a5ea986977d102b298bb7651e5dbbbcef SHA512 e824cca5bb1e98439b152b15674292f042a5df8567ba2439a111af58084277ff800df6b326d6ecf0e3ee325d5ab2d2ddddd9dc31db7a0176828f1690bd855b2a
DIST perf-5.19-binutils-2.39-patches.tar.xz 5612 BLAKE2B ec3aeadc3e2508f33dddbb419f434885b39b8220d294f3845f0bc96282923ff46dca126a04c732b8286752e56087ba5b2c5ad9526884f6d0b8b6df5665121e5e SHA512 af676e5a600e227d85f89a5ee0cfacfe1845aa56c27ef9da3ebaf578362d7e741375d30565759123b33b86d36bc9981c8c4cda113af32745cc59cf4a9275e73b
EBUILD bpftool-5.19.12.ebuild 3256 BLAKE2B a2fc604b44b8539de5cc03eb0b408dd4c0247cbabc238e2e189ec948e4cd3511b55a04a41dc807475d76f403bdc484d9bd2d4f8c17c7f6ecef53639b17ce9054 SHA512 0f6978a5286575a5f8ac91ceb44ff55349d43fbb416eb9da3e95ee682ee059237f7858033a1e9d0846c2c0e63d6dcef4a64187fb16f31a22fab81dd7646fc649
EBUILD bpftool-6.0.12.ebuild 2991 BLAKE2B a1b4d976e8ca3b21e0a956eb1d3a39822e995e9ac305faf0319b528ee73dd21646167b34526a2d715c151b8366b46328b9bd98642550e67d09fc9ff86f43e1a5 SHA512 ca867462dd25204204284bfbf3c3e63433b50cff39e79bbc3be135f301d661b47a4d877c1e7b4ebd6d4816bcbdc78938c7cb5cc320e93066540f8d138dcc74f3
+EBUILD bpftool-6.1.7.ebuild 2991 BLAKE2B a1b4d976e8ca3b21e0a956eb1d3a39822e995e9ac305faf0319b528ee73dd21646167b34526a2d715c151b8366b46328b9bd98642550e67d09fc9ff86f43e1a5 SHA512 ca867462dd25204204284bfbf3c3e63433b50cff39e79bbc3be135f301d661b47a4d877c1e7b4ebd6d4816bcbdc78938c7cb5cc320e93066540f8d138dcc74f3
MISC metadata.xml 356 BLAKE2B 4cc2dafd4a125f2144fc8537377c1857c4cf3ace56242965c41f29b5601b346b211ae8a05459b555569b4a11d2eed39345f02c3fe27ba8a8f93117969ee8b8cc SHA512 c2c0f149fbec22400163df406cdc10df537bef638251eeabc332709992e7470c323b366cfc465d6ecf14f2d84065660cccefef7a5ca45980d679b645ebf664be
diff --git a/dev-util/bpftool/bpftool-6.1.7.ebuild b/dev-util/bpftool/bpftool-6.1.7.ebuild
new file mode 100644
index 000000000000..4f68a43259e9
--- /dev/null
+++ b/dev-util/bpftool/bpftool-6.1.7.ebuild
@@ -0,0 +1,123 @@
+# Copyright 2021-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..10} )
+inherit estack linux-info optfeature python-any-r1 bash-completion-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 ~riscv ~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}
+ 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=(
+ 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 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
+
+ pushd "${S_K}" >/dev/null || die
+ # bug #890638
+ eapply "${FILESDIR}"/5.19.12-no-stack-protector.patch
+ popd || die
+
+ # 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 \
+ bash_compdir="$(get_bashcompdir)" \
+ 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]
+}