commit: ae6bde074c73c17ca38602db064ba647c9ac6319 Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com> AuthorDate: Tue Oct 14 22:02:06 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Oct 15 06:59:46 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae6bde07
dev-debug/bpftrace: check kernel config for tests, improve SRC_URI unpacking Closes: https://bugs.gentoo.org/964293 Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com> Part-of: https://github.com/gentoo/gentoo/pull/44182 Closes: https://github.com/gentoo/gentoo/pull/44182 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-debug/bpftrace/bpftrace-0.24.1.ebuild | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/dev-debug/bpftrace/bpftrace-0.24.1.ebuild b/dev-debug/bpftrace/bpftrace-0.24.1.ebuild index ed264862c6de..861e7c8d525f 100644 --- a/dev-debug/bpftrace/bpftrace-0.24.1.ebuild +++ b/dev-debug/bpftrace/bpftrace-0.24.1.ebuild @@ -31,7 +31,7 @@ S="${WORKDIR}/${PN}-${MY_PV:-${PV}}" LICENSE="Apache-2.0" SLOT="0" -IUSE="pcap test systemd" +IUSE="pcap systemd test" RESTRICT="!test? ( test )" @@ -81,11 +81,21 @@ pkg_pretend() { ~BPF_EVENTS ~BPF_JIT ~BPF_SYSCALL + ~DEBUG_INFO_BTF + ~DEBUG_INFO_BTF_MODULES ~FTRACE_SYSCALLS ~HAVE_EBPF_JIT " 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() { @@ -93,16 +103,22 @@ 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 \"v${rev}\")" cmake/Version.cmake || die + sed -i "/configure_file/i set (BPFTRACE_VERSION \"${rev}\")" cmake/Version.cmake || die fi - # unpack prepackaged man tarball for bpftrace.8 - pushd "${WORKDIR}" && unpack ${PN}-${MAN_V:-${PV}}-man.tar.xz && popd - cmake_src_prepare }
