mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-10 06:57:08 -08:00
dev-debug/bpftrace: add 0.27.1
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
This commit is contained in:
@@ -7,3 +7,5 @@ DIST bpftrace-0.26.1-man.tar.xz 44680 BLAKE2B 21e0c4492b1885f24fdd91c814a5144326
|
||||
DIST bpftrace-0.26.1.tar.gz 1549419 BLAKE2B f9be88f6767de8752d46377f2833a511972166fc2d857fc11c16264e40f42cd39f12f9a8e04e0c8b9b8a3f11b1c4df17b002acbadbf30658d01494bdb206818b SHA512 2b2f052b742317b991b2e267881167ec58f0b7fa24574950f090d237665930a7ddfaa26e9a9f03eb3db01ab111a99ecb8f4b41f1c944b6f1df0218f109bfe72d
|
||||
DIST bpftrace-0.27.0-man.tar.xz 44696 BLAKE2B 89eaa126bc79944f724b54c59da53cbeee13af890bcfe9610dc03d9b638bc42da06e9694f7ba0340763b2a04b69add531a54cc09e13ff9f24275fdca8ac6448e SHA512 7d1e14646d251cbd9078c5c26b7be0c70e214c40a4209712b973ece7dd6e0a10b5f3bd7054da098b0eef7eb0b149314e3e1e533c4c83a7be51e963c6b474526c
|
||||
DIST bpftrace-0.27.0.tar.gz 1565630 BLAKE2B 6d974394586f8567663b78dd7b61f7f400f602bbf51a3688c398d76ee78893cf3f9dd6fc2cc1c831d5c004f6f752fe75e976c55473ddc868cb5cda68a280337e SHA512 269718f346532b4a8544c78e8bbceb68e89210905e0a38eebeccbc992ed673e8a07a786a4f0b258048e4039a9b6ffc5cc3f5435e83b4b6c87854d21aed9d0f9d
|
||||
DIST bpftrace-0.27.1-man.tar.xz 44688 BLAKE2B b76aeec4f4a430ed104cbe5da43342902542d88c1457fafed8de287d24314c363149aaf51e064e4ef0dd682fd47e08c869a0d94b808c9d27accac611aa774abb SHA512 f8c4bdea39b82c69e8a4425ed294ade1721ef51c512f40e57873f8de7d6d2d51d3d798a30d3ddb70054fbbad58092fd5976bd5959188f8f17aa9c249f4402177
|
||||
DIST bpftrace-0.27.1.tar.gz 1569561 BLAKE2B 1cabb5c99b3b3a797eb6743a1521404dc2ded788ee93c32743673a69cacdf926b6c3de1e1690001e34a418c58403a4d9556f793b2af4a7b0e4a4e80ea453e9a9 SHA512 8aea9d6fa15fc9569149652de3398cf643702fd4862acd9e54595210461eab2e21141605a876ae798dc6e218b7ba6f12048d114364ab5055260f980ef14fd5a9
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
# Copyright 2019-2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
LLVM_COMPAT=( {18..23} )
|
||||
RUST_MIN_VER="1.85.0"
|
||||
RUST_OPTIONAL=1
|
||||
|
||||
inherit cmake flag-o-matic linux-info llvm-r2 rust
|
||||
|
||||
DESCRIPTION="High-level tracing language for eBPF"
|
||||
HOMEPAGE="https://github.com/bpftrace/bpftrace"
|
||||
MY_PV="${PV//_/}"
|
||||
|
||||
if [[ ${PV} == *9999* ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/bpftrace/bpftrace"
|
||||
EGIT_BRANCH="master"
|
||||
inherit git-r3
|
||||
# use a released man page for git
|
||||
MAN_V="0.25.0"
|
||||
else
|
||||
SRC_URI="https://github.com/bpftrace/bpftrace/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64 ~arm64"
|
||||
# the man page version may trail the release
|
||||
#MAN_V="0.25.0"
|
||||
fi
|
||||
|
||||
SRC_URI+=" https://github.com/bpftrace/bpftrace/releases/download/v${MAN_V:-${PV}}/man.tar.xz -> bpftrace-${MAN_V:-${PV}}-man.tar.xz"
|
||||
|
||||
S="${WORKDIR}/${PN}-${MY_PV:-${PV}}"
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
|
||||
IUSE="pcap systemd test"
|
||||
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="
|
||||
>=dev-libs/blazesym_c-0.1.1
|
||||
>=dev-libs/libbpf-1.7:=[static-libs]
|
||||
>=dev-util/bcc-0.25.0
|
||||
$(llvm_gen_dep '
|
||||
llvm-core/clang:${LLVM_SLOT}=
|
||||
llvm-core/llvm:${LLVM_SLOT}=[llvm_targets_BPF(+)]
|
||||
')
|
||||
sys-libs/binutils-libs:=
|
||||
virtual/libelf:=
|
||||
systemd? ( sys-apps/systemd:= )
|
||||
pcap? ( net-libs/libpcap:= )
|
||||
virtual/zlib:=
|
||||
"
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
dev-libs/cereal:=
|
||||
test? ( dev-cpp/gtest )
|
||||
"
|
||||
BDEPEND="
|
||||
app-arch/xz-utils
|
||||
app-alternatives/lex
|
||||
app-alternatives/yacc
|
||||
dev-libs/cereal
|
||||
dev-util/bpftool
|
||||
|| ( dev-util/xxd app-editors/vim-core )
|
||||
test? (
|
||||
${RUST_DEPEND}
|
||||
dev-lang/go
|
||||
dev-util/pahole
|
||||
)
|
||||
virtual/pkgconfig
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/0.11.4-old-kernels.patch"
|
||||
"${FILESDIR}/0.21.0-dont-compress-man.patch"
|
||||
)
|
||||
|
||||
pkg_pretend() {
|
||||
local CONFIG_CHECK="
|
||||
~BPF
|
||||
~BPF_EVENTS
|
||||
~BPF_JIT
|
||||
~BPF_SYSCALL
|
||||
~DEBUG_INFO_BTF
|
||||
~DEBUG_INFO_BTF_MODULES
|
||||
~FTRACE_SYSCALLS
|
||||
~HAVE_EBPF_JIT
|
||||
"
|
||||
|
||||
if use test; then
|
||||
# force linux-info to check kernel configurations only in the
|
||||
# running kernel, not in any on-disk configuration (bug 977516)
|
||||
KERNEL_DIR="linux-info-runtime-checks-only"
|
||||
fi
|
||||
|
||||
check_extra_config
|
||||
|
||||
if use test; then
|
||||
if ! linux_config_exists ; then
|
||||
die "Unable to check your kernel for BTF support: tests cannot run."
|
||||
elif ! linux_chkconfig_present DEBUG_INFO_BTF ; then
|
||||
die "CONFIG_DEBUG_INFO_BTF is not set: tests cannot run."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
llvm-r2_pkg_setup
|
||||
use test && rust_pkg_setup
|
||||
}
|
||||
|
||||
# git-r3 overrides automatic SRC_URI unpacking
|
||||
src_unpack() {
|
||||
default
|
||||
|
||||
if [[ ${PV} == *9999* ]] ; then
|
||||
git-r3_src_unpack
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# create a usable version from git
|
||||
if [[ ${PV} == *9999* ]] ; then
|
||||
local rev=$(git branch --show-current | sed -e 's/* //g' -e 's/release\///g')-$(git rev-parse --short HEAD)
|
||||
sed -i "/configure_file/i set (BPFTRACE_VERSION \"${rev}\")" cmake/Version.cmake || die
|
||||
fi
|
||||
|
||||
cmake_src_prepare
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# suppress one remaining and benign ODR violation warning due to
|
||||
# a generated libbpf header used by the tests, see:
|
||||
# https://github.com/bpftrace/bpftrace/issues/4591
|
||||
use test && append-flags -Wno-odr
|
||||
|
||||
local mycmakeargs=(
|
||||
# DO dynamically link the bpftrace executable
|
||||
-DSTATIC_LINKING=OFF
|
||||
# DO NOT build the internal libs as shared
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_TESTING=$(usex test)
|
||||
# we use the pregenerated man page
|
||||
-DENABLE_MAN=OFF
|
||||
-DENABLE_SKB_OUTPUT=$(usex pcap)
|
||||
-DENABLE_SYSTEMD=$(usex systemd)
|
||||
# always use system libbpf
|
||||
-DUSE_SYSTEM_LIBBPF=ON
|
||||
)
|
||||
|
||||
# enable UBSAN only when enabled in the toolchain
|
||||
if is-flagq -fsanitize=undefined; then
|
||||
filter-flags -fsanitize=undefined
|
||||
mycmakeargs+=( -DBUILD_UBSAN=ON )
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
doman man/man8/*.?
|
||||
gunzip "${WORKDIR}/man/man8/bpftrace.8.gz" || die
|
||||
doman "${WORKDIR}/man/man8/bpftrace.8"
|
||||
}
|
||||
Reference in New Issue
Block a user