From dff5148a375dbe1b3ec2c5e5e4fa482bd1224c98 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 5 Sep 2022 04:23:37 +0100 Subject: gentoo auto-resync : 05:09:2022 - 04:23:36 --- dev-util/bpftool/Manifest | 2 + dev-util/bpftool/bpftool-5.19.2-r1.ebuild | 125 ++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 dev-util/bpftool/bpftool-5.19.2-r1.ebuild (limited to 'dev-util/bpftool') diff --git a/dev-util/bpftool/Manifest b/dev-util/bpftool/Manifest index 5e213ac917db..ff0c63838b04 100644 --- a/dev-util/bpftool/Manifest +++ b/dev-util/bpftool/Manifest @@ -3,7 +3,9 @@ DIST linux-5.19.tar.xz 131581464 BLAKE2B 4db03a6830a3b3bbf0837e1912182a443d9a4aa DIST patch-5.18.11.xz 595980 BLAKE2B 74b305bd21c71c9328f02183c3b098ee1e476c1d58e79120b5d9e9ab53da5c32ffe4bba6f4e4c0d75188f187b81fc898fe9fd29762695254e23702caa824f0aa SHA512 5a4972b96438b38aa2bd6b1893557aab528bc465464613ba2c1ef069e501761d995efb26b9a910f638383a821d249d1f6c748e1da993b428c0c4bcbb24621415 DIST patch-5.19.1.xz 7644 BLAKE2B e0e31aa647bd6e5bbd62e7469f62718362c1d7434dd658de30e79a14dc009b64e748b81939ab9999ae6369149cb13e1e75dff3da0c8800a9780260e6d1df7b22 SHA512 a61c71c6fb935b4b256ff3cbdfdaba502af98f2b4b905dfc8f669aae502049bb4b44eb08e362cd6108e17190343e4cc6f39474b1a62287756401b359205708db DIST patch-5.19.2.xz 475316 BLAKE2B e1a3238a1cfb33178d1d9608821ad1f275165b0df0f4883dfd136ebe2ff31839d4cb82af60a874673b256653a0eca625dcb9016179ae9d1522099465b2014642 SHA512 53aecf0c08ce7bbd10e8f7a75397155054badeedbd20a2ef228c6726436e701095a79ae5322c8052550cbd79b8dc02b7caa30c8916cae5733a2bc04ed3157299 +DIST perf-5.19-binutils-2.39-patches.tar.xz 5612 BLAKE2B ec3aeadc3e2508f33dddbb419f434885b39b8220d294f3845f0bc96282923ff46dca126a04c732b8286752e56087ba5b2c5ad9526884f6d0b8b6df5665121e5e SHA512 af676e5a600e227d85f89a5ee0cfacfe1845aa56c27ef9da3ebaf578362d7e741375d30565759123b33b86d36bc9981c8c4cda113af32745cc59cf4a9275e73b EBUILD bpftool-5.18.11.ebuild 2837 BLAKE2B e59a2fa0d3e1836487fea2074b65a80e844ba74ec57e9f435f7d801c31e275455a4e03f0163638381a79f431af47dc43b240770fc8733ed68f70f09d4dc4636d SHA512 9088ae2324c68990f0654e8c938379be87da3b3df2750c4db001e7a6d5c8dbf999a16115d27b0ece324d552f144f6bcd72a8ea074bf3cfbfe5404337c326ef3f EBUILD bpftool-5.19.1.ebuild 2838 BLAKE2B db68f909f5b00257ff8c7516f170eb751abede56e45b908982048be66d488b04839ca9fd5ee1edf961730fa749b01628c1fd6b0ceb3b6410db51dd9151d935f3 SHA512 bf28c750ec794ee6e980cf464e5b23705198bcb35403d183625ea650760a5f9b61da2f0d528f0061f6912d82fe37bb8a7cd2afe73501e5cffa525d33ff66506c +EBUILD bpftool-5.19.2-r1.ebuild 3169 BLAKE2B 60e127ab6fa63d90ed42b237a192eda67866b38afd83f8f22982966367dd95bb780f12e93ee650441d6d0cbc74db1aeaf2c514d84041a0eb8383507f6d1d259d SHA512 c403228451442e14588da6dc73f94fe72afe16ca0dc1bb640bc1e4e46e2fc299025102b3fcbb51e813b96a5a92ff20dc5b6f6450366d77f32f55dbf89e904eb9 EBUILD bpftool-5.19.2.ebuild 2838 BLAKE2B db68f909f5b00257ff8c7516f170eb751abede56e45b908982048be66d488b04839ca9fd5ee1edf961730fa749b01628c1fd6b0ceb3b6410db51dd9151d935f3 SHA512 bf28c750ec794ee6e980cf464e5b23705198bcb35403d183625ea650760a5f9b61da2f0d528f0061f6912d82fe37bb8a7cd2afe73501e5cffa525d33ff66506c MISC metadata.xml 356 BLAKE2B 4cc2dafd4a125f2144fc8537377c1857c4cf3ace56242965c41f29b5601b346b211ae8a05459b555569b4a11d2eed39345f02c3fe27ba8a8f93117969ee8b8cc SHA512 c2c0f149fbec22400163df406cdc10df537bef638251eeabc332709992e7470c323b366cfc465d6ecf14f2d84065660cccefef7a5ca45980d679b645ebf664be diff --git a/dev-util/bpftool/bpftool-5.19.2-r1.ebuild b/dev-util/bpftool/bpftool-5.19.2-r1.ebuild new file mode 100644 index 000000000000..3b2b5a406a29 --- /dev/null +++ b/dev-util/bpftool/bpftool-5.19.2-r1.ebuild @@ -0,0 +1,125 @@ +# 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}" + +SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/dev-util/perf/perf-5.19-binutils-2.39-patches.tar.xz" + +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} + 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 + + pushd "${S_K}" >/dev/null || die + # Used `git format-patch 00b32625982e0c796f0abb8effcac9c05ef55bd3...600b7b26c07a070d0153daa76b3806c1e52c9e00` + # bug #868123 + eapply "${WORKDIR}"/perf-5.19-binutils-2.39-patches + 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 \ + 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] +} -- cgit v1.2.3