dev-util/bcc: require at least elfutils-0.166 for GElf_Nhdr in gelf.h
[gentoo.git] / dev-util / bcc / bcc-0.2.0-r1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 PYTHON_COMPAT=( python2_7 python3_{4,5} )
8
9 inherit cmake-utils linux-info python-single-r1 python-utils-r1
10
11 DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, and more"
12 HOMEPAGE="https://iovisor.github.io/bcc/"
13 EGIT_COMMIT="v${PV}"
14 SRC_URI="https://github.com/iovisor/bcc/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
15 RESTRICT="test"
16
17 LICENSE="Apache-2.0"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86"
20 IUSE=""
21 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
22
23 RDEPEND=">=dev-libs/elfutils-0.166:=
24         sys-devel/clang:=
25         >=sys-devel/llvm-3.7:=[llvm_targets_BPF(+)]
26         ${PYTHON_DEPS}"
27 DEPEND="${RDEPEND}"
28 S=${WORKDIR}/${PN}-${EGIT_COMMIT#v}
29
30 pkg_pretend() {
31         local CONFIG_CHECK="~BPF ~BPF_SYSCALL ~NET_CLS_BPF ~NET_ACT_BPF
32                 ~BPF_JIT ~HAVE_BPF_JIT ~BPF_EVENTS"
33
34         check_extra_config
35 }
36
37 pkg_setup() {
38         python-single-r1_pkg_setup
39 }
40
41 src_configure() {
42         local mycmakeargs=(
43                 -DREVISION=${PV%%_*}
44         )
45
46         cmake-utils_src_configure
47 }
48
49 src_install() {
50         cmake-utils_src_install
51         python_fix_shebang "${ED}"
52 }