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, 30 Oct 2020 21:13:21
Message-Id: 1604092386.890c228fb22fe783aa28bbd7b836dba77d4d2310.chutzpah@gentoo
1 commit: 890c228fb22fe783aa28bbd7b836dba77d4d2310
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Fri Oct 30 21:09:20 2020 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 30 21:13:06 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=890c228f
7
8 dev-util/bcc-0.16.0-r1: Revbump, add tools to path, fix deps
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-3.0.8, Repoman-3.0.2
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 dev-util/bcc/bcc-0.16.0-r1.ebuild | 103 ++++++++++++++++++++++++++++++++++++++
15 1 file changed, 103 insertions(+)
16
17 diff --git a/dev-util/bcc/bcc-0.16.0-r1.ebuild b/dev-util/bcc/bcc-0.16.0-r1.ebuild
18 new file mode 100644
19 index 00000000000..55b56ac3dcb
20 --- /dev/null
21 +++ b/dev-util/bcc/bcc-0.16.0-r1.ebuild
22 @@ -0,0 +1,103 @@
23 +# Copyright 1999-2020 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +PYTHON_COMPAT=( python3_{6..9} )
29 +
30 +inherit cmake linux-info llvm python-r1
31 +
32 +DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more"
33 +HOMEPAGE="https://iovisor.github.io/bcc/"
34 +
35 +SRC_URI="https://github.com/iovisor/bcc/archive/v${PV}.tar.gz -> ${P}.tar.gz"
36 +
37 +LICENSE="Apache-2.0"
38 +SLOT="0"
39 +KEYWORDS="~amd64 ~arm64 ~x86"
40 +IUSE="+luajit test"
41 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
42 +
43 +RDEPEND="
44 + >=dev-libs/libbpf-0.1.0-r1[static-libs(-)]
45 + <dev-libs/libbpf-0.2[static-libs(-)]
46 + >=sys-kernel/linux-headers-4.14
47 + >=dev-libs/elfutils-0.166:=
48 + <=sys-devel/clang-12:=
49 + <=sys-devel/llvm-12:=[llvm_targets_BPF(+)]
50 + luajit? ( dev-lang/luajit )
51 + ${PYTHON_DEPS}
52 +"
53 +DEPEND="${RDEPEND}
54 + test? (
55 + || (
56 + net-misc/iputils[arping]
57 + net-analyzer/arping
58 + )
59 + net-analyzer/netperf
60 + net-misc/iperf:*
61 + )
62 +"
63 +BDEPEND="
64 + dev-util/cmake
65 + virtual/pkgconfig
66 +"
67 +
68 +PATCHES=(
69 + "${FILESDIR}/bcc-0.9.0-no-luajit-automagic-dep.patch"
70 + "${FILESDIR}/bcc-0.14.0-cmakelists.patch"
71 +)
72 +
73 +# tests need root access
74 +RESTRICT="test"
75 +
76 +pkg_pretend() {
77 + local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
78 + ~BPF_JIT ~BPF_EVENTS ~DEBUG_INFO ~FUNCTION_TRACER ~KALLSYMS_ALL
79 + ~KPROBES"
80 +
81 + check_extra_config
82 +}
83 +
84 +pkg_setup() {
85 + LLVM_MAX_SLOT=11 llvm_pkg_setup
86 + python_setup
87 +}
88 +
89 +src_prepare() {
90 + local bpf_link_path
91 +
92 + # this avoids bundling
93 + bpf_link_path="$(realpath --relative-to="${S}/src/cc/libbpf" /usr/include/bpf)" || die
94 + ln -sfn "${bpf_link_path}" src/cc/libbpf/include || die
95 +
96 + cmake_src_prepare
97 +}
98 +
99 +python_add_impl() {
100 + bcc_python_impls+="${EPYTHON};"
101 +}
102 +
103 +src_configure() {
104 + local bcc_python_impls
105 + python_foreach_impl python_add_impl
106 +
107 + local -a mycmakeargs=(
108 + -DREVISION=${PV%%_*}
109 + -DENABLE_LLVM_SHARED=ON
110 + -DCMAKE_USE_LIBBPF_PACKAGE=ON
111 + -DKERNEL_INCLUDE_DIRS="${KERNEL_DIR}"
112 + -DPYTHON_CMD="${bcc_python_impls%;}"
113 + $(usex luajit '-DWITH_LUAJIT=1')
114 + )
115 +
116 + cmake_src_configure
117 +}
118 +
119 +src_install() {
120 + cmake_src_install
121 + python_foreach_impl python_optimize
122 + python_replicate_script $(grep -Flr '#!/usr/bin/python' "${ED}/usr/share/bcc/tools")
123 +
124 + newenvd "${FILESDIR}"/60bcc.env 60bcc.env
125 +}