diff options
author | Patrick McLean <chutzpah@gentoo.org> | 2021-12-02 09:30:33 -0800 |
---|---|---|
committer | Patrick McLean <chutzpah@gentoo.org> | 2021-12-02 09:30:48 -0800 |
commit | ef0f3b1bb4c6bfb876c0af6cb1bcddff39dcef3b (patch) | |
tree | dfb833ad0566bde6bc646a7a09884e29deb5fb68 /dev-util/bpftrace | |
parent | www-client/chromium: dev channel bump to 98.0.4736.0 (diff) | |
download | gentoo-ef0f3b1bb4c6bfb876c0af6cb1bcddff39dcef3b.tar.gz gentoo-ef0f3b1bb4c6bfb876c0af6cb1bcddff39dcef3b.tar.bz2 gentoo-ef0f3b1bb4c6bfb876c0af6cb1bcddff39dcef3b.zip |
dev-util/bpftrace: Fix build with libbpf-0.6.0
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-util/bpftrace')
-rw-r--r-- | dev-util/bpftrace/bpftrace-0.14.0-r4.ebuild | 92 | ||||
-rw-r--r-- | dev-util/bpftrace/files/bpftrace-0.14-libbpf-0.6.patch | 17 |
2 files changed, 109 insertions, 0 deletions
diff --git a/dev-util/bpftrace/bpftrace-0.14.0-r4.ebuild b/dev-util/bpftrace/bpftrace-0.14.0-r4.ebuild new file mode 100644 index 000000000000..0aeeffbf10f6 --- /dev/null +++ b/dev-util/bpftrace/bpftrace-0.14.0-r4.ebuild @@ -0,0 +1,92 @@ +# Copyright 2019-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LLVM_MAX_SLOT=13 + +inherit llvm linux-info cmake + +DESCRIPTION="High-level tracing language for eBPF" +HOMEPAGE="https://github.com/iovisor/bpftrace" +MY_PV="${PV//_/}" +SRC_URI="https://github.com/iovisor/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${MY_PV:-${PV}}" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="fuzzing test" +# lots of fixing needed +RESTRICT="test" + +RDEPEND=" + dev-libs/libbpf:= + >=dev-util/bcc-0.13.0:= + dev-util/systemtap + <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):= + <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_BPF(+)] + sys-libs/binutils-libs:= + virtual/libelf:= +" +DEPEND=" + ${COMMON_DEPEND} + dev-libs/cereal:= + test? ( dev-cpp/gtest ) +" +BDEPEND=" + sys-apps/sed + app-arch/xz-utils + sys-devel/flex + sys-devel/bison + virtual/pkgconfig +" + +QA_DT_NEEDED="/usr/lib.*/libbpftraceresources.so" + +PATCHES=( + "${FILESDIR}/bpftrace-0.14.0-install-libs.patch" + "${FILESDIR}/bpftrace-0.14.0-dont-compress-man.patch" + "${FILESDIR}/bpftrace-0.14.0-fuzzing.patch" + "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch" + "${FILESDIR}/bpftrace-0.12.0-fuzzing-build.patch" + "${FILESDIR}/bpftrace-0.14-libbpf-0.6.patch" +) + +pkg_pretend() { + local CONFIG_CHECK=" + ~BPF + ~BPF_EVENTS + ~BPF_JIT + ~BPF_SYSCALL + ~FTRACE_SYSCALLS + ~HAVE_EBPF_JIT + " + + check_extra_config +} + +pkg_setup() { + llvm_pkg_setup +} + +src_configure() { + local -a mycmakeargs=( + -DSTATIC_LINKING:BOOL=OFF + # bug 809362, 754648 + -DBUILD_SHARED_LIBS:=OFF + -DBUILD_TESTING:BOOL=OFF + -DBUILD_FUZZ:BOOL=$(usex fuzzing) + -DENABLE_MAN:BOOL=OFF + -DLIBBPF_INCLUDE_DIRS="$(pkg-config --cflags-only-I libbpf | sed 's:-I::g')" + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + # bug 809362 + dostrip -x /usr/bin/bpftrace + doman man/man8/*.? +} diff --git a/dev-util/bpftrace/files/bpftrace-0.14-libbpf-0.6.patch b/dev-util/bpftrace/files/bpftrace-0.14-libbpf-0.6.patch new file mode 100644 index 000000000000..e4a383dd69fc --- /dev/null +++ b/dev-util/bpftrace/files/bpftrace-0.14-libbpf-0.6.patch @@ -0,0 +1,17 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 47a050e2..5dd5ff3f 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -123,10 +123,8 @@ endif(STATIC_LINKING) + + target_link_libraries(libbpftrace parser resources runtime aot ast arch cxxdemangler_llvm) + +-if (LIBBPF_BTF_DUMP_FOUND) +- target_include_directories(runtime PUBLIC ${LIBBPF_INCLUDE_DIRS}) +- target_link_libraries(runtime ${LIBBPF_LIBRARIES}) +-endif(LIBBPF_BTF_DUMP_FOUND) ++target_include_directories(runtime PUBLIC ${LIBBPF_INCLUDE_DIRS}) ++target_link_libraries(runtime ${LIBBPF_LIBRARIES}) + + if(HAVE_BFD_DISASM) + if(STATIC_LINKING) |