* [gentoo-commits] repo/gentoo:master commit in: dev-util/bcc/, dev-util/bcc/files/
@ 2019-03-12 0:27 Patrick McLean
0 siblings, 0 replies; 5+ messages in thread
From: Patrick McLean @ 2019-03-12 0:27 UTC (permalink / raw
To: gentoo-commits
commit: 7c033c7f07e7b18074e2c1f8b7e4581d90b22d81
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Tue Mar 12 00:27:26 2019 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 00:27:26 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c033c7f
dev-util/bcc: Version bump to 0.9.0
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bcc/Manifest | 1 +
dev-util/bcc/bcc-0.9.0.ebuild | 63 +++++++++++++
.../files/bcc-0.9.0-no-luajit-automagic-dep.patch | 20 +++++
dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch | 100 +++++++++++++++++++++
4 files changed, 184 insertions(+)
diff --git a/dev-util/bcc/Manifest b/dev-util/bcc/Manifest
index 8ce77c72361..a4b0f0db8d9 100644
--- a/dev-util/bcc/Manifest
+++ b/dev-util/bcc/Manifest
@@ -1,2 +1,3 @@
DIST bcc-0.6.0.tar.gz 1986593 BLAKE2B 514c2c781eb94d99560232d8050b5664ce3565622b236e78cd111be27b3482849965600a1d574f59243917672f00bb3cef65cab63103f6c4a5cf62024c683d9b SHA512 1a8edf6da22f3119a74cf43f03ec83b97ed2f6fc18828d750d8a695ac1451b6b3209e5d2cf48bc87f53fa9447e8813a018a58d31588d477e4aa364a2d0217e80
DIST bcc-0.7.0.tar.gz 2009289 BLAKE2B 370b553521289d983d1165633e76a5e405250b9b09dbf3e78c127d232908e73facce06097ce4dbf0bbccda929b6715a9b7460affe123556087c8ca00b8d62c0b SHA512 ebe6c4cbecba2d587c69af71ddc8cb451b2b8e1d49ef887f291c813320c2c60d49357500fc2751d5b418df2be1d02763c385d89de6efa6e10f049c25acf01b4e
+DIST bcc-0.9.0.tar.gz 2036984 BLAKE2B cebbeb57f06af90442d28be1633a54c198bf796786c4fcca3a83dea03bc76949f958dd24f7d85feb2e3402576410f965754f3d031076486b7d378493c56035e8 SHA512 373080181380ec3bcb13469e29ff1f792e924a2df00a614da4647ed54060ad216525dd0f49c5d0afba7946a6d2f4e3475af97250a33db825945af3d165294091
diff --git a/dev-util/bcc/bcc-0.9.0.ebuild b/dev-util/bcc/bcc-0.9.0.ebuild
new file mode 100644
index 00000000000..403c7245730
--- /dev/null
+++ b/dev-util/bcc/bcc-0.9.0.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
+
+inherit cmake-utils linux-info python-single-r1 python-utils-r1
+
+DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more"
+HOMEPAGE="https://iovisor.github.io/bcc/"
+EGIT_COMMIT="v${PV}"
+SRC_URI="https://github.com/iovisor/bcc/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+RESTRICT="test"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+luajit"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="dev-libs/libbpf:=
+ >=dev-libs/elfutils-0.166:=
+ sys-devel/clang:=
+ >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
+ luajit? ( dev-lang/luajit )
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}"
+BDEPEND="dev-util/cmake
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${PN}-${EGIT_COMMIT#v}
+
+PATCHES=(
+ "${FILESDIR}/bcc-0.9.0-system-libbpf.patch"
+ "${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
+ ~BPF_JIT ~BPF_EVENTS ~DEBUG_INFO ~FUNCTION_TRACER ~KALLSYMS_ALL
+ ~KPROBES"
+
+ check_extra_config
+}
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DREVISION=${PV%%_*}
+ $(usex luajit '-DWITH_LUAJIT=1' '' '' '')
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ python_fix_shebang "${ED}"
+}
diff --git a/dev-util/bcc/files/bcc-0.9.0-no-luajit-automagic-dep.patch b/dev-util/bcc/files/bcc-0.9.0-no-luajit-automagic-dep.patch
new file mode 100644
index 00000000000..ee076efce92
--- /dev/null
+++ b/dev-util/bcc/files/bcc-0.9.0-no-luajit-automagic-dep.patch
@@ -0,0 +1,20 @@
+diff --git a/cmake/FindLuaJIT.cmake b/cmake/FindLuaJIT.cmake
+index 5a2bcf85..7f6e07e4 100644
+--- a/cmake/FindLuaJIT.cmake
++++ b/cmake/FindLuaJIT.cmake
+@@ -28,6 +28,7 @@
+ # 2010 - modified for cronkite to find luajit instead of lua, as it was before.
+ #
+
++if(WITH_LUAJIT)
+ FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
+ HINTS
+ $ENV{LUAJIT_DIR}
+@@ -58,6 +59,7 @@ FIND_LIBRARY(LUAJIT_LIBRARY
+ /opt/csw
+ /opt
+ )
++endif()
+
+ IF(LUAJIT_LIBRARY)
+ IF(UNIX AND NOT APPLE)
diff --git a/dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch b/dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch
new file mode 100644
index 00000000000..18868272dcb
--- /dev/null
+++ b/dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch
@@ -0,0 +1,100 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 94aac856..33492c27 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -61,6 +61,9 @@ FOREACH(DIR ${LLVM_INCLUDE_DIRS})
+ include_directories("${DIR}/../tools/clang/include")
+ ENDFOREACH()
+
++find_package(PkgConfig)
++pkg_check_modules(LIBBPF REQUIRED libbpf)
++
+ # Set to a string path if system places kernel lib directory in
+ # non-default location.
+ if(NOT DEFINED BCC_KERNEL_MODULES_DIR)
+diff --git a/introspection/CMakeLists.txt b/introspection/CMakeLists.txt
+index 88df6e84..a4033c02 100644
+--- a/introspection/CMakeLists.txt
++++ b/introspection/CMakeLists.txt
+@@ -8,6 +8,6 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi)
+ option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON)
+
+ add_executable(bps bps.c)
+-target_link_libraries(bps bpf-static)
++target_link_libraries(bps bpf-static ${LIBBPF_LIBRARIES})
+
+ install (TARGETS bps DESTINATION share/bcc/introspection)
+diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt
+index 59a59856..2af70525 100644
+--- a/src/cc/CMakeLists.txt
++++ b/src/cc/CMakeLists.txt
+@@ -28,7 +28,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_MAJOR_VERSION=${CMAKE_MATCH_1}")
+
+ include(static_libstdc++)
+
+-file(GLOB libbpf_sources "libbpf/src/*.c")
++#file(GLOB libbpf_sources "libbpf/src/*.c")
+ add_library(bpf-static STATIC libbpf.c perf_reader.c ${libbpf_sources})
+ set_target_properties(bpf-static PROPERTIES OUTPUT_NAME bpf)
+ add_library(bpf-shared SHARED libbpf.c perf_reader.c ${libbpf_sources})
+@@ -81,10 +81,10 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f
+ # bcc_common_libs_for_s for shared libraries
+ set(bcc_common_libs_for_a b_frontend clang_frontend bpf-static
+ -Wl,--whole-archive ${clang_libs} ${llvm_libs} -Wl,--no-whole-archive
+- ${LIBELF_LIBRARIES})
++ ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES})
+ set(bcc_common_libs_for_s ${bcc_common_libs_for_a})
+ set(bcc_common_libs_for_lua b_frontend clang_frontend bpf-static
+- ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES})
++ ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES})
+
+ if(ENABLE_CPP_API)
+ add_subdirectory(api)
+@@ -115,4 +115,3 @@ install(DIRECTORY libbpf/include/uapi/linux/ DESTINATION include/bcc/compat/linu
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ endif(ENABLE_CLANG_JIT)
+ install(FILES ${bcc_common_headers} DESTINATION include/bcc)
+-install(TARGETS bpf-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc
+index 881959af..62f73f54 100644
+--- a/src/cc/bcc_btf.cc
++++ b/src/cc/bcc_btf.cc
+@@ -19,8 +19,8 @@
+ #include <string.h>
+ #include "linux/btf.h"
+ #include "libbpf.h"
+-#include "libbpf/src/libbpf.h"
+-#include "libbpf/src/btf.h"
++#include <bpf/libbpf.h>
++#include <bpf/btf.h>
+ #include <vector>
+
+ #define BCC_MAX_ERRNO 4095
+diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc
+index cf6ea8f3..1be7b788 100644
+--- a/src/cc/bpf_module.cc
++++ b/src/cc/bpf_module.cc
+@@ -43,7 +43,7 @@
+ #include "exported_files.h"
+ #include "libbpf.h"
+ #include "bcc_btf.h"
+-#include "libbpf/src/bpf.h"
++#include <bpf/bpf.h>
+
+ namespace ebpf {
+
+diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c
+index 9b0024dc..7b3eca4b 100644
+--- a/src/cc/libbpf.c
++++ b/src/cc/libbpf.c
+@@ -51,8 +51,8 @@
+ // TODO: Remove this when CentOS 6 support is not needed anymore
+ #include "setns.h"
+
+-#include "libbpf/src/bpf.h"
+-#include "libbpf/src/libbpf.h"
++#include <bpf/bpf.h>
++#include <bpf/libbpf.h>
+
+ // TODO: remove these defines when linux-libc-dev exports them properly
+
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bcc/, dev-util/bcc/files/
@ 2019-06-14 17:09 Patrick McLean
0 siblings, 0 replies; 5+ messages in thread
From: Patrick McLean @ 2019-06-14 17:09 UTC (permalink / raw
To: gentoo-commits
commit: 05f1e1549e6016ea2d1083728a896cd761ab4983
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Fri Jun 14 17:08:57 2019 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Fri Jun 14 17:08:57 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05f1e154
dev-util/bcc: Version bump to 0.10.0
Had to drop the patch to unbundle libbpf, the upstream build system
makes too many assumptions about it's presence.
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.67, Repoman-2.3.14
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bcc/Manifest | 2 +
dev-util/bcc/bcc-0.10.0.ebuild | 85 ++++++++++
dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch | 182 ++++++++++++++++++++++
3 files changed, 269 insertions(+)
diff --git a/dev-util/bcc/Manifest b/dev-util/bcc/Manifest
index 136c3b7aa67..c6391f7ee4a 100644
--- a/dev-util/bcc/Manifest
+++ b/dev-util/bcc/Manifest
@@ -1,4 +1,6 @@
+DIST bcc-0.10.0.tar.gz 2052430 BLAKE2B 562aa95d34ba329ce966bca3164af45fe6d78487e5f0d370a0a90c5d91af75b4adcc5aa1e6578bf598e55dc51394c5a218fc19e2b57b2f7241cc3fe1f3a4e513 SHA512 92ba0f57d22af610ac81661526fed8bec80d502bcbc8aa5048ba7c50911247c020832db23afdcf9b555b142cd387c228cf7baa0ddc94067165403e362227f235
DIST bcc-0.6.0.tar.gz 1986593 BLAKE2B 514c2c781eb94d99560232d8050b5664ce3565622b236e78cd111be27b3482849965600a1d574f59243917672f00bb3cef65cab63103f6c4a5cf62024c683d9b SHA512 1a8edf6da22f3119a74cf43f03ec83b97ed2f6fc18828d750d8a695ac1451b6b3209e5d2cf48bc87f53fa9447e8813a018a58d31588d477e4aa364a2d0217e80
DIST bcc-0.7.0.tar.gz 2009289 BLAKE2B 370b553521289d983d1165633e76a5e405250b9b09dbf3e78c127d232908e73facce06097ce4dbf0bbccda929b6715a9b7460affe123556087c8ca00b8d62c0b SHA512 ebe6c4cbecba2d587c69af71ddc8cb451b2b8e1d49ef887f291c813320c2c60d49357500fc2751d5b418df2be1d02763c385d89de6efa6e10f049c25acf01b4e
DIST bcc-0.9.0-linux-5-bpf.patch.xz 28524 BLAKE2B f0369e50eabd7b1eb9a492b9652cd7647c7c7fda3b01db1e7f2bf716e76357d07d67193b31189b98309e26895ac3dd5c755d4cef6bc592e4674f40710c33539c SHA512 fc5b828a5826da2cf1e1a76758c635f5443d202aecbe3f269d78abcaa0117ad7658bea6c43e7b60e1ecc6bcc65bd19b100217758a1203d278ddb03c5837c43f1
DIST bcc-0.9.0.tar.gz 2036984 BLAKE2B cebbeb57f06af90442d28be1633a54c198bf796786c4fcca3a83dea03bc76949f958dd24f7d85feb2e3402576410f965754f3d031076486b7d378493c56035e8 SHA512 373080181380ec3bcb13469e29ff1f792e924a2df00a614da4647ed54060ad216525dd0f49c5d0afba7946a6d2f4e3475af97250a33db825945af3d165294091
+DIST libbpf-0.0.3.tar.gz 127328 BLAKE2B eaa1be54f0a7fcc6fd41eb2adaad2f405f76db3bd7c7466a5484ead1cca5a9fe775e331838cd5645d7399cb5b1a5b2fcb3814fb45643660fd3f7d84b9986bae6 SHA512 ee489d968cd9a20a1f091dcd2696d3807ab0db2a001613684402de2c696391eea033f3bd961eaf1d0df95c1e15f4f0ccfb7003ff98c3f08f24a7e9a8db22cdad
diff --git a/dev-util/bcc/bcc-0.10.0.ebuild b/dev-util/bcc/bcc-0.10.0.ebuild
new file mode 100644
index 00000000000..e58cc92b1c9
--- /dev/null
+++ b/dev-util/bcc/bcc-0.10.0.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
+
+inherit cmake-utils linux-info python-single-r1 python-utils-r1
+
+EGIT_COMMIT="v${PV}"
+LIBBPF_VER="0.0.3"
+
+DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more"
+HOMEPAGE="https://iovisor.github.io/bcc/"
+
+# This bundles libbpf, I tried to unbundle it, but I am not good enough
+# with cmake to do it. Patches accepted...
+SRC_URI="https://github.com/iovisor/bcc/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
+ https://github.com/libbpf/libbpf/archive/${LIBBPF_VER}.tar.gz -> libbpf-${LIBBPF_VER}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+luajit test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND=">=sys-kernel/linux-headers-4.18
+ >=dev-libs/elfutils-0.166:=
+ sys-devel/clang:=
+ >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
+ luajit? ( dev-lang/luajit )
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ test? (
+ || (
+ net-misc/iputils[arping]
+ net-analyzer/arping
+ )
+ net-analyzer/netperf
+ net-misc/iperf:*
+ )"
+BDEPEND="dev-util/cmake
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${PN}-${EGIT_COMMIT#v}
+
+PATCHES=(
+ "${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch"
+)
+
+# tests need root access
+RESTRICT="test"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
+ ~BPF_JIT ~BPF_EVENTS ~DEBUG_INFO ~FUNCTION_TRACER ~KALLSYMS_ALL
+ ~KPROBES"
+
+ check_extra_config
+}
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ rmdir src/cc/libbpf || die
+ mv "${WORKDIR}"/libbpf-${LIBBPF_VER} src/cc/libbpf || die
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DREVISION=${PV%%_*}
+ $(usex luajit '-DWITH_LUAJIT=1' '' '' '')
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ python_fix_shebang "${ED}"
+}
diff --git a/dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch b/dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch
new file mode 100644
index 00000000000..fabb3f3f2e6
--- /dev/null
+++ b/dev-util/bcc/files/bcc-0.10.0-system-libbpf.patch
@@ -0,0 +1,182 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 94aac856..bd454226 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -9,12 +9,6 @@ endif()
+
+ enable_testing()
+
+-# populate submodules (libbpf)
+-if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src)
+- execute_process(COMMAND git submodule update --init --recursive
+- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+-endif()
+-
+ include(cmake/GetGitRevisionDescription.cmake)
+ include(cmake/version.cmake)
+ include(CMakeDependentOption)
+@@ -61,6 +55,9 @@ FOREACH(DIR ${LLVM_INCLUDE_DIRS})
+ include_directories("${DIR}/../tools/clang/include")
+ ENDFOREACH()
+
++find_package(PkgConfig)
++pkg_check_modules(LIBBPF REQUIRED libbpf)
++
+ # Set to a string path if system places kernel lib directory in
+ # non-default location.
+ if(NOT DEFINED BCC_KERNEL_MODULES_DIR)
+diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
+index 906c9aaf..210f0f75 100644
+--- a/examples/cpp/CMakeLists.txt
++++ b/examples/cpp/CMakeLists.txt
+@@ -3,7 +3,7 @@
+
+ include_directories(${CMAKE_SOURCE_DIR}/src/cc)
+ include_directories(${CMAKE_SOURCE_DIR}/src/cc/api)
+-include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi)
++include_directories(${LIBBPF_INCLUDE_DIRS})
+
+ option(INSTALL_CPP_EXAMPLES "Install C++ examples. Those binaries are statically linked and can take plenty of disk space" OFF)
+
+diff --git a/examples/cpp/pyperf/CMakeLists.txt b/examples/cpp/pyperf/CMakeLists.txt
+index 6f963c66..e8dd66f6 100644
+--- a/examples/cpp/pyperf/CMakeLists.txt
++++ b/examples/cpp/pyperf/CMakeLists.txt
+@@ -3,7 +3,7 @@
+
+ include_directories(${CMAKE_SOURCE_DIR}/src/cc)
+ include_directories(${CMAKE_SOURCE_DIR}/src/cc/api)
+-include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi)
++include_directories(${LIBBPF_INCLUDE_DIRS})
+
+ add_executable(PyPerf PyPerf.cc PyPerfUtil.cc PyPerfBPFProgram.cc PyPerfLoggingHelper.cc PyPerfDefaultPrinter.cc Py36Offsets.cc)
+ target_link_libraries(PyPerf bcc-static)
+diff --git a/introspection/CMakeLists.txt b/introspection/CMakeLists.txt
+index 88df6e84..de8a6464 100644
+--- a/introspection/CMakeLists.txt
++++ b/introspection/CMakeLists.txt
+@@ -3,11 +3,11 @@
+
+ include_directories(${CMAKE_SOURCE_DIR}/src/cc)
+ include_directories(${CMAKE_SOURCE_DIR}/src/cc/api)
+-include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi)
++include_directories(${LIBBPF_INCLUDE_DIRS})
+
+ option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON)
+
+ add_executable(bps bps.c)
+-target_link_libraries(bps bpf-static)
++target_link_libraries(bps ${LIBBPF_LIBRARIES})
+
+ install (TARGETS bps DESTINATION share/bcc/introspection)
+diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt
+index bd34fd48..dfbeb596 100644
+--- a/src/cc/CMakeLists.txt
++++ b/src/cc/CMakeLists.txt
+@@ -10,8 +10,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frontends/clang)
+ include_directories(${LLVM_INCLUDE_DIRS})
+ include_directories(${LIBELF_INCLUDE_DIRS})
+ # todo: if check for kernel version
+-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include)
+-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include/uapi)
++include_directories(${LIBBPF_INCLUDE_DIRS})
+ add_definitions(${LLVM_DEFINITIONS})
+ configure_file(libbcc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc @ONLY)
+
+@@ -28,13 +27,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_MAJOR_VERSION=${CMAKE_MATCH_1}")
+
+ include(static_libstdc++)
+
+-file(GLOB libbpf_sources "libbpf/src/*.c")
+-add_library(bpf-static STATIC libbpf.c perf_reader.c ${libbpf_sources})
+-set_target_properties(bpf-static PROPERTIES OUTPUT_NAME bcc_bpf)
+-add_library(bpf-shared SHARED libbpf.c perf_reader.c ${libbpf_sources})
+-set_target_properties(bpf-shared PROPERTIES VERSION ${REVISION_LAST} SOVERSION 0)
+-set_target_properties(bpf-shared PROPERTIES OUTPUT_NAME bcc_bpf)
+-
+ set(bcc_common_sources bcc_common.cc bpf_module.cc bcc_btf.cc exported_files.cc)
+ if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 6 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 6)
+ set(bcc_common_sources ${bcc_common_sources} bcc_debug.cc)
+@@ -79,12 +71,12 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f
+
+ # bcc_common_libs_for_a for archive libraries
+ # bcc_common_libs_for_s for shared libraries
+-set(bcc_common_libs_for_a b_frontend clang_frontend bpf-static
++set(bcc_common_libs_for_a b_frontend clang_frontend
+ -Wl,--whole-archive ${clang_libs} ${llvm_libs} -Wl,--no-whole-archive
+- ${LIBELF_LIBRARIES})
++ ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES})
+ set(bcc_common_libs_for_s ${bcc_common_libs_for_a})
+-set(bcc_common_libs_for_lua b_frontend clang_frontend bpf-static
+- ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES})
++set(bcc_common_libs_for_lua b_frontend clang_frontend
++ ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES})
+
+ if(ENABLE_CPP_API)
+ add_subdirectory(api)
+@@ -111,8 +103,7 @@ set(bcc-lua-static ${bcc-lua-static} ${bcc_common_libs_for_lua})
+ install(TARGETS bcc-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES ${bcc_table_headers} DESTINATION include/bcc)
+ install(FILES ${bcc_api_headers} DESTINATION include/bcc)
+-install(DIRECTORY libbpf/include/uapi/linux/ DESTINATION include/bcc/compat/linux FILES_MATCHING PATTERN "*.h")
++#install(DIRECTORY libbpf/include/uapi/linux/ DESTINATION include/bcc/compat/linux FILES_MATCHING PATTERN "*.h")
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ endif(ENABLE_CLANG_JIT)
+ install(FILES ${bcc_common_headers} DESTINATION include/bcc)
+-install(TARGETS bpf-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc
+index 12816757..29e4c707 100644
+--- a/src/cc/bcc_btf.cc
++++ b/src/cc/bcc_btf.cc
+@@ -19,8 +19,8 @@
+ #include <string.h>
+ #include "linux/btf.h"
+ #include "libbpf.h"
+-#include "libbpf/src/libbpf.h"
+-#include "libbpf/src/btf.h"
++#include <bpf/libbpf.h>
++#include <bpf/btf.h>
+ #include <vector>
+
+ #define BCC_MAX_ERRNO 4095
+diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc
+index 836c458f..eb03ce59 100644
+--- a/src/cc/bpf_module.cc
++++ b/src/cc/bpf_module.cc
+@@ -43,7 +43,7 @@
+ #include "exported_files.h"
+ #include "libbpf.h"
+ #include "bcc_btf.h"
+-#include "libbpf/src/bpf.h"
++#include <bpf/bpf.h>
+
+ namespace ebpf {
+
+diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c
+index 63f4894e..83147dbe 100644
+--- a/src/cc/libbpf.c
++++ b/src/cc/libbpf.c
+@@ -52,8 +52,8 @@
+ // TODO: Remove this when CentOS 6 support is not needed anymore
+ #include "setns.h"
+
+-#include "libbpf/src/bpf.h"
+-#include "libbpf/src/libbpf.h"
++#include <bpf/bpf.h>
++#include <bpf/libbpf.h>
+
+ // TODO: remove these defines when linux-libc-dev exports them properly
+
+diff --git a/tests/cc/CMakeLists.txt b/tests/cc/CMakeLists.txt
+index a47abe14..ae710eb4 100644
+--- a/tests/cc/CMakeLists.txt
++++ b/tests/cc/CMakeLists.txt
+@@ -3,7 +3,7 @@
+
+ include_directories(${CMAKE_SOURCE_DIR}/src/cc)
+ include_directories(${CMAKE_SOURCE_DIR}/src/cc/api)
+-include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi)
++include_directories(${LIBBPF_INCLUDE_DIRS})
+
+ add_executable(test_static test_static.c)
+ target_link_libraries(test_static bcc-static)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bcc/, dev-util/bcc/files/
@ 2020-04-21 17:55 Patrick McLean
0 siblings, 0 replies; 5+ messages in thread
From: Patrick McLean @ 2020-04-21 17:55 UTC (permalink / raw
To: gentoo-commits
commit: d9f411b30cbca64159b1775467ef554345dddc64
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 21 17:55:28 2020 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Apr 21 17:55:28 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9f411b3
dev-util/bcc-0.14.0: Version bump
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bcc/Manifest | 2 +
dev-util/bcc/bcc-0.14.0.ebuild | 93 ++++++++++++++++++++++++++
dev-util/bcc/files/bcc-0.14.0-cmakelists.patch | 19 ++++++
3 files changed, 114 insertions(+)
diff --git a/dev-util/bcc/Manifest b/dev-util/bcc/Manifest
index c2fcfba21e8..66472c8c076 100644
--- a/dev-util/bcc/Manifest
+++ b/dev-util/bcc/Manifest
@@ -1,6 +1,8 @@
DIST bcc-0.11.0.tar.gz 2611511 BLAKE2B db12e10a3da11b1d3691ca5e0e036f56af4c5765d49e2edefc3e30bc90036a5f521d196db797e3725e618efa68ba2550848b3dc044015f6aea6b2da6ca2a34f5 SHA512 4854a5a15a89a8bd3a10daa6f0e831428316751280902cbdc74f3c6f78263ee1c58521ae9125804e72fec6482702818a5fec781436400640627e4b7c2fc189fb
DIST bcc-0.12.0.tar.gz 2627075 BLAKE2B 44c435eaaf6233ad24249cf5da4e778cd31e41573199ded97d1f411c7424128fb11f838c55fa48c692b4d5f267ea594d6cab9992dc76137da1b41453285c98c5 SHA512 db3ea929b1296f4d9d82d2a11e89e11a1c31512d3f7f935475a7613e0128a5cf9441f3138969535ef41de0c0f677c7446f62f1c64575d41a9896e5339f3f112b
DIST bcc-0.13.0.tar.gz 3928016 BLAKE2B ecaf2dc077a5e0b808ea1d588a89793291ed56de8747e1cb59f0e841b70e4a4f0333e2941ee2b42b5b9a570cd8d4f9941be772e7790186be156e452a416d40bb SHA512 7c82007979814ac11d1dfc81fe8e00d988f518f7fbba3e115851e17500c22eca23b33b84f9053acc10aefda0ee3b80429f8daf1389590c2d3686ee8d7ced72cb
+DIST bcc-0.14.0.tar.gz 4021098 BLAKE2B 2c66c82e14ee7f858f2e4ff8aa158d03c1580686f4023e920f643454283ed26265ec1e122695a308c4e570c369a0f66e6b0a9347fd9046f2eeb6cd4b536e4dc6 SHA512 216033a6944134c9f9b03a254c83236ff49b02c87808d2719a51a5ebe3b2e3f6b283e905cfbbc85084eab60cf8ef89c3135b4e07ddb9bd83348c69f6e49a84b8
DIST libbpf-0.0.5.tar.gz 160335 BLAKE2B 2cf4a3e6edc002b3a32f9d08bb22a07863d8f6f90472e9593a9e9a93b08a00f0557d5a59fa841325b947e6f7b129232e7cd1fdc906f45de57b0dbe594548f1c2 SHA512 e42f6cc8f834f2d3cf9138d655bd3727ffffb2693850f7f6409ec4d536336bc5fa479a64eefc802a5915e333677eca843f8f1bd0132589bba10bdc89064eee0c
DIST libbpf-0.0.6.tar.gz 213791 BLAKE2B 9f0a08cc7bae41f7fa93d5ba2f535f76ce47fe691efb6bac6257b88a5607deb62fa53f59984d83b6070ccd573c902899f7528b376d9acbfd77317659de6ab061 SHA512 1678133d9a2bd1cf13d4d1f9b83bb3f0642de91e3e3c8d785e2993257035573aff39b9a1a457e73d9c4c1c66b6a52544a8ad06ac560766d335428bb3fc421e71
DIST libbpf-0.0.7.tar.gz 262068 BLAKE2B e77ff25449274881ddb9d32f25cd6ad8988e4524102bd109049ee6cfce3e2753fd99ebe2a080f809a4c5422dbf6b17633e4b0cea156f289bf95b92f8375a273c SHA512 c2cbc869b7e11339deab3152a6e2d0b3bba25da513d18d77fb0a698cbe61d6bd48175a58e7dd7a3695fbf27faf48b4f517ac5d3a3c66c086df2e5d1b73a2595d
+DIST libbpf-0.0.8.tar.gz 262519 BLAKE2B 2a3620c97834cc23e716476b6966c1c65c1c82064b3ba1ae4ab4906ae362a777d9aa7ae40620f9a259fe969a5a897e97c14d97f627f39c47fa28c89abb1efa9a SHA512 1074fb52b7a158e4e2713c4c7083528ccf2d99b899853078f230234ba112071bfa66e174d8800d36516e26d5bf06da44d100a5b2f866d267f62c9308f431220c
diff --git a/dev-util/bcc/bcc-0.14.0.ebuild b/dev-util/bcc/bcc-0.14.0.ebuild
new file mode 100644
index 00000000000..5b4acaeb9b3
--- /dev/null
+++ b/dev-util/bcc/bcc-0.14.0.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit cmake-utils linux-info llvm python-single-r1
+
+EGIT_COMMIT="v${PV}"
+LIBBPF_VER="0.0.8"
+
+DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more"
+HOMEPAGE="https://iovisor.github.io/bcc/"
+
+# This bundles libbpf, I tried to unbundle it, but I am not good enough
+# with cmake to do it. Patches accepted...
+SRC_URI="https://github.com/iovisor/bcc/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
+ https://github.com/libbpf/libbpf/archive/v${LIBBPF_VER}.tar.gz -> libbpf-${LIBBPF_VER}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+luajit test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ >=sys-kernel/linux-headers-4.14
+ >=dev-libs/elfutils-0.166:=
+ <sys-devel/clang-10:=
+ <sys-devel/llvm-10:=[llvm_targets_BPF(+)]
+ luajit? ( dev-lang/luajit )
+ ${PYTHON_DEPS}
+"
+DEPEND="${RDEPEND}
+ test? (
+ || (
+ net-misc/iputils[arping]
+ net-analyzer/arping
+ )
+ net-analyzer/netperf
+ net-misc/iperf:*
+ )
+"
+BDEPEND="
+ dev-util/cmake
+ virtual/pkgconfig
+"
+
+S=${WORKDIR}/${PN}-${EGIT_COMMIT#v}
+
+PATCHES=(
+ "${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch"
+ "${FILESDIR}/bcc-0.14.0-cmakelists.patch"
+)
+
+# tests need root access
+RESTRICT="test"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
+ ~BPF_JIT ~BPF_EVENTS ~DEBUG_INFO ~FUNCTION_TRACER ~KALLSYMS_ALL
+ ~KPROBES"
+
+ check_extra_config
+}
+
+pkg_setup() {
+ LLVM_MAX_SLOT=9 llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ rmdir src/cc/libbpf || die
+ mv "${WORKDIR}"/libbpf-${LIBBPF_VER} src/cc/libbpf || die
+
+ cmake-utils_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DREVISION=${PV%%_*}
+ $(usex luajit '-DWITH_LUAJIT=1' '' '' '')
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ python_fix_shebang "${ED}"
+ python_optimize
+}
diff --git a/dev-util/bcc/files/bcc-0.14.0-cmakelists.patch b/dev-util/bcc/files/bcc-0.14.0-cmakelists.patch
new file mode 100644
index 00000000000..3155e3cee96
--- /dev/null
+++ b/dev-util/bcc/files/bcc-0.14.0-cmakelists.patch
@@ -0,0 +1,19 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 65e78ffe..837b4939 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,14 +3,6 @@
+ cmake_minimum_required(VERSION 2.8.7)
+
+ project(bcc)
+-if(NOT CMAKE_BUILD_TYPE)
+- set(CMAKE_BUILD_TYPE Release)
+-endif()
+-
+-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+- set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "path to install" FORCE)
+-endif()
+-
+ enable_testing()
+
+ # populate submodules (libbpf)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bcc/, dev-util/bcc/files/
@ 2024-09-10 19:00 Patrick McLean
0 siblings, 0 replies; 5+ messages in thread
From: Patrick McLean @ 2024-09-10 19:00 UTC (permalink / raw
To: gentoo-commits
commit: 21eaf15549cde98cadfb8c6dc45ae762b0eeb383
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 10 18:59:04 2024 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Sep 10 19:00:24 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21eaf155
dev-util/bcc: add 0.31.0
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-util/bcc/Manifest | 1 +
dev-util/bcc/bcc-0.31.0.ebuild | 175 +++++++++++++++++++++
.../bcc-0.31.0-dont-install-static-libs.patch | 13 ++
3 files changed, 189 insertions(+)
diff --git a/dev-util/bcc/Manifest b/dev-util/bcc/Manifest
index c0ded9bb2e07..21248e0a7452 100644
--- a/dev-util/bcc/Manifest
+++ b/dev-util/bcc/Manifest
@@ -1,3 +1,4 @@
DIST bcc-0.28.0.tar.gz 6148954 BLAKE2B cfd3c8d63128e050512462449ff7d467f8f809c239ac01ae8e75365e89116ec351641a68682d23472aa3b4e265547bb20ca5572084c532a40ccd3131edf255a2 SHA512 792ce93dba64b1f87390b2602dcaeba04ac8b2863652b06eb9a907b93bc6137a944b856cc6fa9c7a38671c89814740967561ca4f3b29c267babca7dc5e78aa02
DIST bcc-0.29.1.tar.gz 6778304 BLAKE2B 23df483df59ef7d66117b15628299a32155136aa5254edbf76f7507a972f3ebcba1d4b2aa83c41e8f061eeeb96812f522c34fed27e9a37e5f4ad3478c7cde88f SHA512 9e60130ea602e19e6c6f88a8c17023cea5daf4c5bcc7af8816e9f5c662341136eb449a3fdf870ffad215495ac3bf895115c0d968d92ce79ebe2899b3e2464d24
DIST bcc-0.30.0.tar.gz 6797246 BLAKE2B 517f4fcce8bcaf4c8c17075f9a906b452ee14a0c46fa500c301521fe46d854fcf4f632e741b34168dfeb819d9b0d64b967e716fa6222ba7dcaeddb03570985e6 SHA512 70478ca8c18e7f106c462513ca9af46f49b4ebcca6380a9393208fca88f83895a7396f918bf5d01dce1bc4a876bccb9b95aa56d426e55d384cf11c9baaa6a89b
+DIST bcc-0.31.0.tar.gz 6807504 BLAKE2B 75739914a18a7952bbefbed6f55b88d3be4f0483d2fd74bf7d6f7a6491d659ab893e7bd6b5e74c7b2239d6a2a9db04522487e3b36e7ddf65b1cc2d8712f786a8 SHA512 a1fe855c316d0508814dc02382b13897ff565bee52de0fc9d7521eabd304227e41bf7d322b10ab29fd5b13aeac85cc75ee76ac348cf1f4bb6499b8853bac10ab
diff --git a/dev-util/bcc/bcc-0.31.0.ebuild b/dev-util/bcc/bcc-0.31.0.ebuild
new file mode 100644
index 000000000000..274d6f9b7d3a
--- /dev/null
+++ b/dev-util/bcc/bcc-0.31.0.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( luajit )
+DISTUTILS_OPTIONAL=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+LLVM_COMPAT=( {15..18} )
+
+inherit cmake linux-info llvm-r1 lua-single distutils-r1 toolchain-funcs
+
+DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more"
+HOMEPAGE="https://iovisor.github.io/bcc/"
+SRC_URI="https://github.com/iovisor/bcc/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
+IUSE="+lua +python static-libs test"
+
+REQUIRED_USE="
+ ${PYTHON_REQUIRED_USE}
+ lua? ( python ${LUA_REQUIRED_USE} )
+"
+
+# tests need root access
+RESTRICT="test"
+
+RDEPEND="
+ >=dev-libs/elfutils-0.166:=
+ >=dev-libs/libbpf-1.2.0:=
+ sys-kernel/linux-headers
+ $(llvm_gen_dep '
+ sys-devel/clang:${LLVM_SLOT}=
+ sys-devel/llvm:${LLVM_SLOT}=
+ ')
+ python? ( ${PYTHON_DEPS} )
+ lua? ( ${LUA_DEPS} )
+"
+DEPEND="
+ ${RDEPEND}
+ test? (
+ || (
+ net-misc/iputils[arping]
+ net-analyzer/arping
+ )
+ net-analyzer/netperf
+ net-misc/iperf:*
+ )
+"
+BDEPEND="
+ app-arch/zip
+ virtual/pkgconfig
+ python? ( ${DISTUTILS_DEPS} )
+"
+
+PATCHES=(
+ "${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch"
+ "${FILESDIR}/bcc-0.25.0-cmakelists.patch"
+ "${FILESDIR}/bcc-0.23.0-man-compress.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
+ ~HAVE_EBPF_JIT ~BPF_EVENTS ~DEBUG_INFO ~FUNCTION_TRACER ~KALLSYMS_ALL
+ ~KPROBES"
+
+ check_extra_config
+}
+
+pkg_setup() {
+ llvm-r1_pkg_setup
+ use python && python_setup
+}
+
+bcc_distutils_phase() {
+ if use python; then
+ local python_phase_func="distutils-r1_${EBUILD_PHASE_FUNC}"
+
+ if declare -f "${python_phase_func}" > /dev/null; then
+ pushd "${S}/src/python" > /dev/null || die
+ MY_S="${S}" S="${S}/src/python" "${python_phase_func}"
+ popd > /dev/null || die
+ else
+ die "Called ${FUNCNAME[0]} called in ${EBUILD_PHASE_FUNC}, but ${python_phase_func} doesn't exist"
+ fi
+ fi
+}
+
+src_prepare() {
+ local bpf_link_path
+
+ # this avoids bundling
+ bpf_link_path="$(realpath --relative-to="${S}/src/cc/libbpf" /usr/include/bpf)" || die
+ ln -sfn "${bpf_link_path}" src/cc/libbpf/include || die
+
+ # bug 811288
+ local script scriptname
+ for script in $(find tools/old -type f -name "*.py" || die); do
+ mv "${script}" "tools/old/old-${script##*/}" || die
+ done
+
+ use static-libs || PATCHES+=( "${FILESDIR}/bcc-0.31.0-dont-install-static-libs.patch" )
+
+ # use distutils-r1 eclass funcs rather than letting upstream handle python
+ printf '\n' > src/python/CMakeLists.txt || die
+
+ if use python; then
+ for python_file in $(find "${S}/src/python" -name '*.py.in' || die); do
+ sed "s:@REVISION@:${PV%%_*}:" "${python_file}" > "${python_file%.in}" || die
+ done
+ fi
+
+ cmake_src_prepare
+ bcc_distutils_phase
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DREVISION=${PV%%_*}
+ -DENABLE_LLVM_SHARED=ON
+ -DENABLE_NO_PIE=OFF
+ -DCMAKE_USE_LIBBPF_PACKAGE=ON
+ -DLIBBPF_INCLUDE_DIRS="$($(tc-getPKG_CONFIG) --cflags-only-I libbpf | sed 's:-I::g')"
+ -DKERNEL_INCLUDE_DIRS="${KERNEL_DIR}"
+ -Wno-dev
+ )
+ if use lua && use lua_single_target_luajit; then
+ mycmakeargs+=( -DWITH_LUAJIT=1 )
+ fi
+
+ cmake_src_configure
+ bcc_distutils_phase
+}
+
+src_compile() {
+ cmake_src_compile
+ bcc_distutils_phase
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ local tool
+ for tool in $(grep -Elr '#!/usr/bin/(env |)python' "${MY_S}/tools"); do
+ local tool_name="${tool##*/}"
+ python_newscript "${tool}" "${tool_name%.py}"
+ done
+}
+
+src_install() {
+ cmake_src_install
+ bcc_distutils_phase
+
+ newenvd "${FILESDIR}"/60bcc.env 60bcc.env
+ local -A rename_tools=(
+ [trace]=1
+ )
+
+ local tool name
+ for tool in "${ED}"/usr/share/bcc/tools/*; do
+ [[ ! -x ${tool} && ! -L ${tool} || -d ${tool} ]] && continue
+ name=${tool##*/}
+ [[ -n ${rename_tools[${name}]} ]] && name=bcc-${name}
+ dosym -r "${tool#${ED}}" /usr/sbin/${name}
+ done
+
+ docompress /usr/share/${PN}/man
+
+ newenvd - "70${P}" <<-_EOF_
+ MANPATH="${EPREFIX}/usr/share/${PN}/man"
+ _EOF_
+}
diff --git a/dev-util/bcc/files/bcc-0.31.0-dont-install-static-libs.patch b/dev-util/bcc/files/bcc-0.31.0-dont-install-static-libs.patch
new file mode 100644
index 000000000000..b600f128ebb0
--- /dev/null
+++ b/dev-util/bcc/files/bcc-0.31.0-dont-install-static-libs.patch
@@ -0,0 +1,13 @@
+diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt
+index 104eff0e..e34b911a 100644
+--- a/src/cc/CMakeLists.txt
++++ b/src/cc/CMakeLists.txt
+@@ -179,7 +179,7 @@ target_link_libraries(bcc-shared ${bcc_common_libs_for_s})
+ target_link_libraries(bcc-static ${bcc_common_libs_for_a} bcc-loader-static)
+ set(bcc-lua-static ${bcc-lua-static} ${bcc_common_libs_for_lua})
+
+-install(TARGETS bcc-shared bcc-static bcc-loader-static bpf-static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(TARGETS bcc-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES ${bcc_table_headers} DESTINATION include/bcc)
+ install(FILES ${bcc_api_headers} DESTINATION include/bcc)
+ install(DIRECTORY ${libbpf_uapi} DESTINATION include/bcc/compat/linux FILES_MATCHING PATTERN "*.h")
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-util/bcc/, dev-util/bcc/files/
@ 2024-09-11 17:30 Patrick McLean
0 siblings, 0 replies; 5+ messages in thread
From: Patrick McLean @ 2024-09-11 17:30 UTC (permalink / raw
To: gentoo-commits
commit: 80637f03d8c6f0cc71efa1139c4d4098e2a49a77
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 11 17:22:03 2024 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed Sep 11 17:30:05 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80637f03
dev-util/bcc: restore tool symlinking, add missing deps, musl fix
- Restore tool symlinking, making sure to skip python tools
- Add some logic to tool symlinking to avoid collisions
- Prefix tool name for some more generically named tools with bcc-
- Add some missing dependencies (libffi, zstd, ncurses[tinfo], flex, bison)
- Add lzma USE flag and remove automagic dep
- Restore musl fix that somehow got lost (bug #939453)
Closes: https://bugs.gentoo.org/939453
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
.../{bcc-0.31.0-r1.ebuild => bcc-0.31.0-r2.ebuild} | 55 +++++++++++++++++++---
.../bcc/files/bcc-0.31.0-no-automagic-deps.patch | 15 ++++++
2 files changed, 63 insertions(+), 7 deletions(-)
diff --git a/dev-util/bcc/bcc-0.31.0-r1.ebuild b/dev-util/bcc/bcc-0.31.0-r2.ebuild
similarity index 77%
rename from dev-util/bcc/bcc-0.31.0-r1.ebuild
rename to dev-util/bcc/bcc-0.31.0-r2.ebuild
index 445bbb4a71ca..f595931e6352 100644
--- a/dev-util/bcc/bcc-0.31.0-r1.ebuild
+++ b/dev-util/bcc/bcc-0.31.0-r2.ebuild
@@ -18,7 +18,7 @@ SRC_URI="https://github.com/iovisor/bcc/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
-IUSE="+lua +python static-libs test"
+IUSE="+lua lzma +python static-libs test"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
@@ -29,13 +29,20 @@ REQUIRED_USE="
RESTRICT="test"
RDEPEND="
+ app-arch/zstd:=
>=dev-libs/elfutils-0.166:=
>=dev-libs/libbpf-1.2.0:=
+ dev-libs/libffi:=
sys-kernel/linux-headers
+ sys-libs/ncurses:=[tinfo]
$(llvm_gen_dep '
sys-devel/clang:${LLVM_SLOT}=
sys-devel/llvm:${LLVM_SLOT}=
')
+ lzma? ( || (
+ app-arch/xz-utils
+ app-arch/lzma
+ ) )
python? ( ${PYTHON_DEPS} )
lua? ( ${LUA_DEPS} )
"
@@ -52,6 +59,8 @@ DEPEND="
"
BDEPEND="
app-arch/zip
+ sys-devel/flex
+ sys-devel/bison
virtual/pkgconfig
python? ( ${DISTUTILS_DEPS} )
"
@@ -60,6 +69,7 @@ PATCHES=(
"${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch"
"${FILESDIR}/bcc-0.25.0-cmakelists.patch"
"${FILESDIR}/bcc-0.23.0-man-compress.patch"
+ "${FILESDIR}/bcc-0.31.0-no-automagic-deps.patch"
)
pkg_pretend() {
@@ -102,6 +112,8 @@ src_prepare() {
mv "${script}" "tools/old/old-${script##*/}" || die
done
+ sed -i '/#include <error.h>/d' examples/cpp/KModRetExample.cc || die
+
use static-libs || PATCHES+=( "${FILESDIR}/bcc-0.31.0-dont-install-static-libs.patch" )
# use distutils-r1 eclass funcs rather than letting upstream handle python
@@ -122,13 +134,15 @@ src_configure() {
-DREVISION=${PV%%_*}
-DENABLE_LLVM_SHARED=ON
-DENABLE_NO_PIE=OFF
+ -DWITH_LZMA=$(usex lzma)
-DCMAKE_USE_LIBBPF_PACKAGE=ON
-DLIBBPF_INCLUDE_DIRS="$($(tc-getPKG_CONFIG) --cflags-only-I libbpf | sed 's:-I::g')"
-DKERNEL_INCLUDE_DIRS="${KERNEL_DIR}"
+ -DNO_BLAZESYM=ON
-Wno-dev
)
if use lua && use lua_single_target_luajit; then
- mycmakeargs+=( -DWITH_LUAJIT=1 )
+ mycmakeargs+=( -DWITH_LUAJIT=ON )
fi
cmake_src_configure
@@ -140,13 +154,32 @@ src_compile() {
bcc_distutils_phase
}
+bcc_tool_name() {
+ local -A rename_tools=(
+ [trace]=1
+ [profile]=1
+ [inject]=1
+ [capable]=1
+ )
+
+ local name="${1}"
+
+ local name="${name##*/}"
+ name="${name%.py}"
+
+ [[ -n ${rename_tools[${name}]} ]] && name=bcc-${name}
+
+ printf -- '%s\n' "${name}"
+}
+
python_install() {
distutils-r1_python_install
+ python_scriptinto /usr/sbin
+
local tool
for tool in $(grep -Elr '#!/usr/bin/(env |)python' "${MY_S}/tools"); do
- local tool_name="${tool##*/}"
- python_newscript "${tool}" "${tool_name%.py}"
+ python_newscript "${tool}" "$(bcc_tool_name "${tool}")"
done
}
@@ -155,9 +188,17 @@ src_install() {
bcc_distutils_phase
newenvd "${FILESDIR}"/60bcc.env 60bcc.env
- local -A rename_tools=(
- [trace]=1
- )
+
+ local tool target
+ for tool in "${ED}"/usr/share/bcc/tools/*; do
+ [[ -d ${tool} || ! -x ${tool} || ${tool} =~ .*[.](c|txt) ]] && continue
+ grep -qE '^#!/usr/bin/(env |)python' "${tool}" && continue
+
+ target="/usr/sbin/$(bcc_tool_name "${tool}")"
+ [[ -e ${ED}${target} ]] && continue
+
+ dosym -r "${tool#${ED}}" "${target}"
+ done
docompress /usr/share/${PN}/man
diff --git a/dev-util/bcc/files/bcc-0.31.0-no-automagic-deps.patch b/dev-util/bcc/files/bcc-0.31.0-no-automagic-deps.patch
new file mode 100644
index 000000000000..baadf2f7ea6c
--- /dev/null
+++ b/dev-util/bcc/files/bcc-0.31.0-no-automagic-deps.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 18407e86..1af91242 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -136,7 +136,9 @@ if(NOT PYTHON_ONLY)
+ find_package(FLEX)
+ find_package(LibElf REQUIRED)
+ find_package(LibDebuginfod)
+- find_package(LibLzma)
++ if(WITH_LZMA)
++ find_package(LibLzma)
++ endif()
+ if(CLANG_DIR)
+ set(CMAKE_FIND_ROOT_PATH "${CLANG_DIR}")
+ include_directories("${CLANG_DIR}/include")
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-09-11 17:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-10 19:00 [gentoo-commits] repo/gentoo:master commit in: dev-util/bcc/, dev-util/bcc/files/ Patrick McLean
-- strict thread matches above, loose matches on Subject: below --
2024-09-11 17:30 Patrick McLean
2020-04-21 17:55 Patrick McLean
2019-06-14 17:09 Patrick McLean
2019-03-12 0:27 Patrick McLean
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox