1 # Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
2 # Contributor: Gordian Edenhofer <gordian.edenhofer@gmail.com>
3 # Contributor: Troy Engel <troyengel+arch@gmail.com>
6 pkgname=('bcc' 'bcc-tools' 'python-bcc')
9 pkgdesc='BPF Compiler Collection'
11 url='https://github.com/iovisor/bcc'
13 makedepends=('cmake' 'clang' 'llvm' 'flex' 'bison' 'python' 'python-setuptools')
14 checkdepends=('netperf' 'iperf')
15 source=("bcc-$pkgver.tar.gz"::"https://github.com/iovisor/bcc/releases/download/v$pkgver/bcc-src-with-submodule.tar.gz")
16 sha512sums=('cf339db1b026d4183ff863188fd7c4a3b6b6c9ef56b42469a8c38bf91b0a9684b21e01fe304a88530626527f4b9f2d44c0e6f30af4152147f5a0fb72125610e3')
21 export CFLAGS+=" -ffat-lto-objects"
22 export CXXFLAGS+=" -ffat-lto-objects"
24 # The python version is irrelevant at this stage
25 cmake -DREVISION=$pkgver \
26 -DCMAKE_INSTALL_PREFIX=/usr \
27 -DCMAKE_INSTALL_LIBDIR=/usr/lib .. \
28 -DENABLE_TESTS=OFF -DRUN_LUA_TESTS=OFF \
29 -DENABLE_LLVM_SHARED=1 # FS#71163
35 pkgdesc='BPF Compiler Collection - C library and examples'
36 depends=('clang' 'libelf')
37 optdepends=('linux-headers: build modules against the Arch kernel'
38 'linux-lts-headers: build modules against the LTS kernel'
39 'linux-zen-headers: build modules against the ZEN kernel'
40 'linux-hardened-headers: build modules against the HARDENED kernel'
41 'bcc-tools: Python utilites using the BCC library'
42 'python-bcc: Python 3 bindings for BCC'
43 'luajit: Lua bindings for BCC')
44 provides=('bcc' 'libbcc')
48 # Install the kitchen sink
49 make DESTDIR="$pkgdir" install
51 # These go in a split package python*-bcc
52 rm -rf "$pkgdir"/usr/lib/python*
54 # These go in a split package bcc-tools
55 rm -rf "$pkgdir"/usr/share/bcc/{tools,man}
59 pkgdesc='BPF Compiler Collection - Tools'
60 depends=('bcc' 'libedit' 'ethtool' 'python-bcc')
64 make -C tools DESTDIR="$pkgdir" install
65 make -C man DESTDIR="$pkgdir" install
68 package_python-bcc() {
69 pkgdesc='BPF Compiler Collection - Python 3 bindings'
70 depends=('bcc' 'python')
72 'python-netaddr: Network address representation and manipulation'
73 'python-pyroute2: Netlink and Linux network configuration'
78 # Force a quick python3 binding build (C library is already built)
79 cmake -DREVISION=$pkgver \
80 -DPYTHON_CMD="python" \
81 -DCMAKE_INSTALL_PREFIX=/usr \
82 -DCMAKE_INSTALL_LIBDIR=/usr/lib ..
85 # Install just those bindings
86 make -C "src/python" DESTDIR="$pkgdir" install