aboutsummaryrefslogtreecommitdiffstats
path: root/testing/bpftrace/APKBUILD
blob: e41034305cff46308bc2429e17e1ba48f68f9c71 (plain) (blame)
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
# Contributor: Konstantin Kulikov <k.kulikov2@gmail.com>
# Maintainer: Konstantin Kulikov <k.kulikov2@gmail.com>
pkgname=bpftrace
pkgver=0.9.4
pkgrel=1
pkgdesc="High-level tracing language for Linux eBPF"
url="https://github.com/iovisor/bpftrace"
arch="x86_64"
license="Apache-2.0"
makedepends="cmake llvm9-dev llvm9-static clang-dev clang-static
	flex-dev bison elfutils-dev linux-headers bcc-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/iovisor/bpftrace/archive/v$pkgver.tar.gz"
# Tests require root, network to download gmock and a few tests fail.
options="!check"
builddir="$srcdir/$pkgname-$pkgver/build"
subpackages="$pkgname-doc $pkgname-tools:tools:noarch $pkgname-tools-doc:tools_doc"

prepare() {
	default_prepare
	mkdir $builddir
}

build() {
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DBUILD_TESTING:BOOL=OFF \
		-DLLVM_REQUESTED_VERSION=9 \
		..
	make
}

package() {
	make DESTDIR="$pkgdir" install

	mv "$pkgdir/usr/man" "$pkgdir/usr/share/bpftrace/man"
	mv "$pkgdir/usr/share/bpftrace/tools/doc" "$pkgdir/usr/share/bpftrace/tools_doc"

	mkdir -p "$pkgdir/usr/share/man/man8"
	mv "$pkgdir/usr/share/bpftrace/man/man8/bpftrace.8.gz" "$pkgdir/usr/share/man/man8/bpftrace.8.gz"
}

tools() {
	depends="$pkgname"
	pkgdesc="$pkgdesc (tools)"
	mkdir -p "$subpkgdir/usr/share/bpftrace"
	mv "$pkgdir/usr/share/bpftrace/tools" "$subpkgdir/usr/share/bpftrace/tools"
}

tools_doc() {
	pkgdesc="$pkgdesc (tool docs and examples)"

	mkdir -p "$subpkgdir/usr/share/bpftrace"
	mv "$pkgdir/usr/share/bpftrace/tools_doc" "$subpkgdir/usr/share/bpftrace/doc"
	mv "$pkgdir/usr/share/bpftrace/man" "$subpkgdir/usr/share/bpftrace/man"
}

sha512sums="d2b32235fa81d6f06771df32877388a9105230adfc638b0d0ebf4f11a567246e8514d93c14da9c7008dbacd6b2c4108604fc5a2721ef831efa5c596cbe50b1da  bpftrace-0.9.4.tar.gz"