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/
Date: Fri, 14 Jan 2022 18:54:50
Message-Id: 1642186481.f4a8549451ba098dcee697e91861bcc46f5980b6.chutzpah@gentoo
1 commit: f4a8549451ba098dcee697e91861bcc46f5980b6
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 14 18:54:16 2022 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 14 18:54:41 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4a85494
7
8 dev-util/bcc: Unkeyworded version bump to 0.24.0
9
10 Unkeyworded until dev-libs/bcc gets a release as this depends on changes
11 that aren't in any releases yet.
12
13 Package-Manager: Portage-3.0.30, Repoman-3.0.3
14 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
15
16 dev-util/bcc/Manifest | 1 +
17 dev-util/bcc/bcc-0.24.0.ebuild | 137 +++++++++++++++++++++++++++++++++++++++++
18 2 files changed, 138 insertions(+)
19
20 diff --git a/dev-util/bcc/Manifest b/dev-util/bcc/Manifest
21 index f8bfaf2e5224..5571324f1eb7 100644
22 --- a/dev-util/bcc/Manifest
23 +++ b/dev-util/bcc/Manifest
24 @@ -1 +1,2 @@
25 DIST bcc-0.23.0.tar.gz 5254103 BLAKE2B 011559f081dd8f95b45b64e347ed191f585f6f5e395aadc3ef9726785aa41735b263c0d6e7743c969e390792f0f4f286930fee585c1a59878f301c4b4026dce8 SHA512 531626c920f5ef7d05617b3b418d55fdeef2dc8014f942a6e68ca457433d63445cc98303bbe331ee982e4aefe5d2df84764d373a6166638bd457992b371f037c
26 +DIST bcc-0.24.0.tar.gz 4640711 BLAKE2B 91d333c21c55de6a0ae78f9bb0b003803578525746e63ca5047896c0b2ed03ee880e03a84511470576e888e46559c67a8ebfdfe49d8785d094e2361bb20c5c2e SHA512 951672e3a8e5ad56eedf513477317ec3d3b4cf2d594bbfce20f3d19ddf7ce255e9dcfc69d9b05bb765a16e769c8e42d7c57071ddb86fb32437f527d3d25d19b6
27
28 diff --git a/dev-util/bcc/bcc-0.24.0.ebuild b/dev-util/bcc/bcc-0.24.0.ebuild
29 new file mode 100644
30 index 000000000000..019bdcd9fa81
31 --- /dev/null
32 +++ b/dev-util/bcc/bcc-0.24.0.ebuild
33 @@ -0,0 +1,137 @@
34 +# Copyright 1999-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +LUA_COMPAT=( luajit )
40 +PYTHON_COMPAT=( python3_{7..10} )
41 +LLVM_MAX_SLOT=13
42 +
43 +inherit cmake eapi8-dosym linux-info llvm lua-single python-r1 toolchain-funcs
44 +
45 +DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more"
46 +HOMEPAGE="https://iovisor.github.io/bcc/"
47 +SRC_URI="https://github.com/iovisor/bcc/archive/v${PV}.tar.gz -> ${P}.tar.gz"
48 +
49 +LICENSE="Apache-2.0"
50 +SLOT="0"
51 +#KEYWORDS="~amd64 ~arm64 ~x86"
52 +IUSE="+lua test"
53 +
54 +REQUIRED_USE="
55 + ${PYTHON_REQUIRED_USE}
56 + lua? ( ${LUA_REQUIRED_USE} )
57 +"
58 +
59 +# tests need root access
60 +RESTRICT="test"
61 +
62 +RDEPEND="
63 + >=dev-libs/elfutils-0.166:=
64 + >=dev-libs/libbpf-0.7.0:=[static-libs(-)]
65 + sys-kernel/linux-headers
66 + <sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
67 + <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=[llvm_targets_BPF(+)]
68 + ${PYTHON_DEPS}
69 + lua? ( ${LUA_DEPS} )
70 +"
71 +DEPEND="
72 + ${RDEPEND}
73 + test? (
74 + || (
75 + net-misc/iputils[arping]
76 + net-analyzer/arping
77 + )
78 + net-analyzer/netperf
79 + net-misc/iperf:*
80 + )
81 +"
82 +BDEPEND="
83 + virtual/pkgconfig
84 +"
85 +
86 +PATCHES=(
87 + "${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch"
88 + "${FILESDIR}/bcc-0.14.0-cmakelists.patch"
89 + "${FILESDIR}/bcc-0.23.0-man-compress.patch"
90 +)
91 +
92 +pkg_pretend() {
93 + local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
94 + ~HAVE_EBPF_JIT ~BPF_EVENTS ~DEBUG_INFO ~FUNCTION_TRACER ~KALLSYMS_ALL
95 + ~KPROBES"
96 +
97 + check_extra_config
98 +}
99 +
100 +pkg_setup() {
101 + llvm_pkg_setup
102 + python_setup
103 +}
104 +
105 +src_prepare() {
106 + local bpf_link_path
107 +
108 + # this avoids bundling
109 + bpf_link_path="$(realpath --relative-to="${S}/src/cc/libbpf" /usr/include/bpf)" || die
110 + ln -sfn "${bpf_link_path}" src/cc/libbpf/include || die
111 +
112 + # bug 811288
113 + local script scriptname
114 + for script in $(find tools/old -type f -name "*.py" || die); do
115 + scriptname=$(basename ${script} || die)
116 + mv ${script} tools/old/old-${scriptname} || die
117 + done
118 +
119 + cmake_src_prepare
120 +}
121 +
122 +python_add_impl() {
123 + bcc_python_impls+="${EPYTHON};"
124 +}
125 +
126 +src_configure() {
127 + local bcc_python_impls
128 + python_foreach_impl python_add_impl
129 +
130 + local -a mycmakeargs=(
131 + -DREVISION=${PV%%_*}
132 + -DENABLE_LLVM_SHARED=ON
133 + -DCMAKE_USE_LIBBPF_PACKAGE=ON
134 + -DLIBBPF_INCLUDE_DIRS="$($(tc-getPKG_CONFIG) --cflags-only-I libbpf | sed 's:-I::g')"
135 + -DKERNEL_INCLUDE_DIRS="${KERNEL_DIR}"
136 + -DPYTHON_CMD="${bcc_python_impls%;}"
137 + -Wno-dev
138 + )
139 + if use lua && use lua_single_target_luajit; then
140 + mycmakeargs+=( -DWITH_LUAJIT=1 )
141 + fi
142 +
143 + cmake_src_configure
144 +}
145 +
146 +src_install() {
147 + cmake_src_install
148 +
149 + python_replicate_script $(grep -Flr '#!/usr/bin/python' "${ED}/usr/share/bcc/tools")
150 + python_foreach_impl python_optimize
151 +
152 + newenvd "${FILESDIR}"/60bcc.env 60bcc.env
153 + local -A rename_tools=(
154 + [trace]=1
155 + )
156 +
157 + local tool name
158 + for tool in "${ED}"/usr/share/bcc/tools/*; do
159 + [[ ! -x ${tool} && ! -L ${tool} || -d ${tool} ]] && continue
160 + name=${tool##*/}
161 + [[ -n ${rename_tools[${name}]} ]] && name=bcc-${name}
162 + dosym8 -r "${tool#${ED}}" /usr/sbin/${name}
163 + done
164 +
165 + docompress /usr/share/${PN}/man
166 +
167 + newenvd - "70${P}" <<-_EOF_
168 + MANPATH="${EPREFIX}/usr/share/${PN}/man"
169 + _EOF_
170 +}