Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/bcc/, dev-util/bcc/files/
Date: Tue, 12 Mar 2019 00:27:40
Message-Id: 1552350446.7c033c7f07e7b18074e2c1f8b7e4581d90b22d81.chutzpah@gentoo
1 commit: 7c033c7f07e7b18074e2c1f8b7e4581d90b22d81
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Tue Mar 12 00:27:26 2019 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 12 00:27:26 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c033c7f
7
8 dev-util/bcc: Version bump to 0.9.0
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-2.3.62, Repoman-2.3.12
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 dev-util/bcc/Manifest | 1 +
15 dev-util/bcc/bcc-0.9.0.ebuild | 63 +++++++++++++
16 .../files/bcc-0.9.0-no-luajit-automagic-dep.patch | 20 +++++
17 dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch | 100 +++++++++++++++++++++
18 4 files changed, 184 insertions(+)
19
20 diff --git a/dev-util/bcc/Manifest b/dev-util/bcc/Manifest
21 index 8ce77c72361..a4b0f0db8d9 100644
22 --- a/dev-util/bcc/Manifest
23 +++ b/dev-util/bcc/Manifest
24 @@ -1,2 +1,3 @@
25 DIST bcc-0.6.0.tar.gz 1986593 BLAKE2B 514c2c781eb94d99560232d8050b5664ce3565622b236e78cd111be27b3482849965600a1d574f59243917672f00bb3cef65cab63103f6c4a5cf62024c683d9b SHA512 1a8edf6da22f3119a74cf43f03ec83b97ed2f6fc18828d750d8a695ac1451b6b3209e5d2cf48bc87f53fa9447e8813a018a58d31588d477e4aa364a2d0217e80
26 DIST bcc-0.7.0.tar.gz 2009289 BLAKE2B 370b553521289d983d1165633e76a5e405250b9b09dbf3e78c127d232908e73facce06097ce4dbf0bbccda929b6715a9b7460affe123556087c8ca00b8d62c0b SHA512 ebe6c4cbecba2d587c69af71ddc8cb451b2b8e1d49ef887f291c813320c2c60d49357500fc2751d5b418df2be1d02763c385d89de6efa6e10f049c25acf01b4e
27 +DIST bcc-0.9.0.tar.gz 2036984 BLAKE2B cebbeb57f06af90442d28be1633a54c198bf796786c4fcca3a83dea03bc76949f958dd24f7d85feb2e3402576410f965754f3d031076486b7d378493c56035e8 SHA512 373080181380ec3bcb13469e29ff1f792e924a2df00a614da4647ed54060ad216525dd0f49c5d0afba7946a6d2f4e3475af97250a33db825945af3d165294091
28
29 diff --git a/dev-util/bcc/bcc-0.9.0.ebuild b/dev-util/bcc/bcc-0.9.0.ebuild
30 new file mode 100644
31 index 00000000000..403c7245730
32 --- /dev/null
33 +++ b/dev-util/bcc/bcc-0.9.0.ebuild
34 @@ -0,0 +1,63 @@
35 +# Copyright 1999-2019 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
41 +
42 +inherit cmake-utils linux-info python-single-r1 python-utils-r1
43 +
44 +DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more"
45 +HOMEPAGE="https://iovisor.github.io/bcc/"
46 +EGIT_COMMIT="v${PV}"
47 +SRC_URI="https://github.com/iovisor/bcc/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
48 +RESTRICT="test"
49 +
50 +LICENSE="Apache-2.0"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~x86"
53 +IUSE="+luajit"
54 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
55 +
56 +RDEPEND="dev-libs/libbpf:=
57 + >=dev-libs/elfutils-0.166:=
58 + sys-devel/clang:=
59 + >=sys-devel/llvm-3.7.1:=[llvm_targets_BPF(+)]
60 + luajit? ( dev-lang/luajit )
61 + ${PYTHON_DEPS}"
62 +DEPEND="${RDEPEND}"
63 +BDEPEND="dev-util/cmake
64 + virtual/pkgconfig"
65 +
66 +S=${WORKDIR}/${PN}-${EGIT_COMMIT#v}
67 +
68 +PATCHES=(
69 + "${FILESDIR}/bcc-0.9.0-system-libbpf.patch"
70 + "${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch"
71 +)
72 +
73 +pkg_pretend() {
74 + local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
75 + ~BPF_JIT ~BPF_EVENTS ~DEBUG_INFO ~FUNCTION_TRACER ~KALLSYMS_ALL
76 + ~KPROBES"
77 +
78 + check_extra_config
79 +}
80 +
81 +pkg_setup() {
82 + python-single-r1_pkg_setup
83 +}
84 +
85 +src_configure() {
86 + local mycmakeargs=(
87 + -DREVISION=${PV%%_*}
88 + $(usex luajit '-DWITH_LUAJIT=1' '' '' '')
89 + )
90 +
91 + cmake-utils_src_configure
92 +}
93 +
94 +src_install() {
95 + cmake-utils_src_install
96 + python_fix_shebang "${ED}"
97 +}
98
99 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
100 new file mode 100644
101 index 00000000000..ee076efce92
102 --- /dev/null
103 +++ b/dev-util/bcc/files/bcc-0.9.0-no-luajit-automagic-dep.patch
104 @@ -0,0 +1,20 @@
105 +diff --git a/cmake/FindLuaJIT.cmake b/cmake/FindLuaJIT.cmake
106 +index 5a2bcf85..7f6e07e4 100644
107 +--- a/cmake/FindLuaJIT.cmake
108 ++++ b/cmake/FindLuaJIT.cmake
109 +@@ -28,6 +28,7 @@
110 + # 2010 - modified for cronkite to find luajit instead of lua, as it was before.
111 + #
112 +
113 ++if(WITH_LUAJIT)
114 + FIND_PATH(LUAJIT_INCLUDE_DIR lua.h
115 + HINTS
116 + $ENV{LUAJIT_DIR}
117 +@@ -58,6 +59,7 @@ FIND_LIBRARY(LUAJIT_LIBRARY
118 + /opt/csw
119 + /opt
120 + )
121 ++endif()
122 +
123 + IF(LUAJIT_LIBRARY)
124 + IF(UNIX AND NOT APPLE)
125
126 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
127 new file mode 100644
128 index 00000000000..18868272dcb
129 --- /dev/null
130 +++ b/dev-util/bcc/files/bcc-0.9.0-system-libbpf.patch
131 @@ -0,0 +1,100 @@
132 +diff --git a/CMakeLists.txt b/CMakeLists.txt
133 +index 94aac856..33492c27 100644
134 +--- a/CMakeLists.txt
135 ++++ b/CMakeLists.txt
136 +@@ -61,6 +61,9 @@ FOREACH(DIR ${LLVM_INCLUDE_DIRS})
137 + include_directories("${DIR}/../tools/clang/include")
138 + ENDFOREACH()
139 +
140 ++find_package(PkgConfig)
141 ++pkg_check_modules(LIBBPF REQUIRED libbpf)
142 ++
143 + # Set to a string path if system places kernel lib directory in
144 + # non-default location.
145 + if(NOT DEFINED BCC_KERNEL_MODULES_DIR)
146 +diff --git a/introspection/CMakeLists.txt b/introspection/CMakeLists.txt
147 +index 88df6e84..a4033c02 100644
148 +--- a/introspection/CMakeLists.txt
149 ++++ b/introspection/CMakeLists.txt
150 +@@ -8,6 +8,6 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi)
151 + option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON)
152 +
153 + add_executable(bps bps.c)
154 +-target_link_libraries(bps bpf-static)
155 ++target_link_libraries(bps bpf-static ${LIBBPF_LIBRARIES})
156 +
157 + install (TARGETS bps DESTINATION share/bcc/introspection)
158 +diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt
159 +index 59a59856..2af70525 100644
160 +--- a/src/cc/CMakeLists.txt
161 ++++ b/src/cc/CMakeLists.txt
162 +@@ -28,7 +28,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_MAJOR_VERSION=${CMAKE_MATCH_1}")
163 +
164 + include(static_libstdc++)
165 +
166 +-file(GLOB libbpf_sources "libbpf/src/*.c")
167 ++#file(GLOB libbpf_sources "libbpf/src/*.c")
168 + add_library(bpf-static STATIC libbpf.c perf_reader.c ${libbpf_sources})
169 + set_target_properties(bpf-static PROPERTIES OUTPUT_NAME bpf)
170 + add_library(bpf-shared SHARED libbpf.c perf_reader.c ${libbpf_sources})
171 +@@ -81,10 +81,10 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${llvm_lib_exclude_f
172 + # bcc_common_libs_for_s for shared libraries
173 + set(bcc_common_libs_for_a b_frontend clang_frontend bpf-static
174 + -Wl,--whole-archive ${clang_libs} ${llvm_libs} -Wl,--no-whole-archive
175 +- ${LIBELF_LIBRARIES})
176 ++ ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES})
177 + set(bcc_common_libs_for_s ${bcc_common_libs_for_a})
178 + set(bcc_common_libs_for_lua b_frontend clang_frontend bpf-static
179 +- ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES})
180 ++ ${clang_libs} ${llvm_libs} ${LIBELF_LIBRARIES} ${LIBBPF_LIBRARIES})
181 +
182 + if(ENABLE_CPP_API)
183 + add_subdirectory(api)
184 +@@ -115,4 +115,3 @@ install(DIRECTORY libbpf/include/uapi/linux/ DESTINATION include/bcc/compat/linu
185 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
186 + endif(ENABLE_CLANG_JIT)
187 + install(FILES ${bcc_common_headers} DESTINATION include/bcc)
188 +-install(TARGETS bpf-shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
189 +diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc
190 +index 881959af..62f73f54 100644
191 +--- a/src/cc/bcc_btf.cc
192 ++++ b/src/cc/bcc_btf.cc
193 +@@ -19,8 +19,8 @@
194 + #include <string.h>
195 + #include "linux/btf.h"
196 + #include "libbpf.h"
197 +-#include "libbpf/src/libbpf.h"
198 +-#include "libbpf/src/btf.h"
199 ++#include <bpf/libbpf.h>
200 ++#include <bpf/btf.h>
201 + #include <vector>
202 +
203 + #define BCC_MAX_ERRNO 4095
204 +diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc
205 +index cf6ea8f3..1be7b788 100644
206 +--- a/src/cc/bpf_module.cc
207 ++++ b/src/cc/bpf_module.cc
208 +@@ -43,7 +43,7 @@
209 + #include "exported_files.h"
210 + #include "libbpf.h"
211 + #include "bcc_btf.h"
212 +-#include "libbpf/src/bpf.h"
213 ++#include <bpf/bpf.h>
214 +
215 + namespace ebpf {
216 +
217 +diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c
218 +index 9b0024dc..7b3eca4b 100644
219 +--- a/src/cc/libbpf.c
220 ++++ b/src/cc/libbpf.c
221 +@@ -51,8 +51,8 @@
222 + // TODO: Remove this when CentOS 6 support is not needed anymore
223 + #include "setns.h"
224 +
225 +-#include "libbpf/src/bpf.h"
226 +-#include "libbpf/src/libbpf.h"
227 ++#include <bpf/bpf.h>
228 ++#include <bpf/libbpf.h>
229 +
230 + // TODO: remove these defines when linux-libc-dev exports them properly
231 +