aboutsummaryrefslogtreecommitdiffstats
path: root/community/bcc/APKBUILD
blob: b96c3cb5c30d3cc21858e6fc2f3df5e6b2c33119 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer: Adam Jensen <acjensen@gmail.com>
pkgname=bcc
pkgver=0.11.0
pkgrel=1
pkgdesc="A toolkit for creating efficient kernel tracing and manipulation programs"
url="https://github.com/iovisor/bcc/"
arch="aarch64 x86 x86_64"
license="Apache-2.0"
# bcc's test suite requires privileged access to run BPF programs
options="!check"
subpackages="$pkgname-dev $pkgname-doc:_doc $pkgname-tools:_tools $pkgname-lua:_lua py3-$pkgname:_py"
_llvmver=9
makedepends="tar git llvm$_llvmver-dev llvm$_llvmver-static clang-dev clang-static cmake
	python3 flex-dev bison luajit-dev build-base iperf linux-headers elfutils-dev zlib-dev
	libbpf-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/iovisor/bcc/archive/v$pkgver.tar.gz
	10-use-system-libbpf.patch"

prepare() {
	rm -rf tests/* && touch tests/CMakeLists.txt
	rm -rf examples/* && touch examples/CMakeLists.txt

	default_prepare
}

build() {
	mkdir -p "$builddir/build"
	cd "$builddir/build"
	cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
		-DCMAKE_INSTALL_LIBDIR=/usr/lib \
		-DPYTHON_CMD=python3 \
		-DREVISION=$pkgver \
		..
	make
}

package() {
	cd "$builddir/build"
	make install DESTDIR="$pkgdir"
}

_doc() {
	pkgdesc="$pkgdesc (documentation)"

	mkdir -p "$subpkgdir"/usr/share/bcc/tools
	mv "$pkgdir"/usr/share/bcc/man "$subpkgdir"/usr/share/bcc
	mv "$pkgdir"/usr/share/bcc/tools/doc "$subpkgdir"/usr/share/bcc/tools
}

_tools() {
	depends="$pkgname py3-$pkgname"
	pkgdesc="$pkgdesc (tools)"

	mkdir -p "$subpkgdir"/usr/share/bcc
	mv "$pkgdir"/usr/share/bcc/tools "$subpkgdir"/usr/share/bcc
	mv "$pkgdir"/usr/share/bcc/introspection "$subpkgdir"/usr/share/bcc
}

_py() {
	depends="$pkgname python3"
	pkgdesc="$pkgdesc (python3 bindings)"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python3* "$subpkgdir"/usr/lib
}

_lua() {
	depends="$pkgname"
	pkgdesc="$pkgdesc (lua bindings)"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/bcc-lua "$subpkgdir"/usr/bin
}

sha512sums="4854a5a15a89a8bd3a10daa6f0e831428316751280902cbdc74f3c6f78263ee1c58521ae9125804e72fec6482702818a5fec781436400640627e4b7c2fc189fb  bcc-0.11.0.tar.gz
f2aa0e3184f11a80d98f5a68d7f46799d471818dafb03d9683c09f33ed2400a3c570807ef6773d4011f0851217089f976ffeff9f5d3279a81e5f551dadc506b5  10-use-system-libbpf.patch"