db-move: moved webkitgtk-6.0 from [testing] to [extra] (x86_64)
[arch-packages.git] / pahole / trunk / PKGBUILD
blobb1d89599cc16bbe358453221f680e998dfab20fc
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
3 pkgbase=pahole
4 pkgname=(
5   pahole
6   ostra-cg
8 pkgver=1.25
9 pkgrel=4
10 epoch=1
11 pkgdesc="Pahole and other DWARF utils"
12 url="https://git.kernel.org/pub/scm/devel/pahole/pahole.git"
13 arch=(x86_64)
14 license=(GPL2)
15 makedepends=(
16   bash
17   cmake
18   libelf
19   ninja
20   python
21   python-matplotlib
22   zlib
24 _commit=02d67c51765dfbd5893087da63744c864c7cc9e0  # master
25 source=(
26   https://fedorapeople.org/~acme/dwarves/dwarves-$pkgver.tar.{xz,sign}
27   python.diff
29 b2sums=('1926fa1fa123fc3ad0f7f063406260b1e1e2611c563fedebee4c837e491164571fdb40408421c0c4ea2fd24e89c54a7a1ea669313b6dd6d7dcfa4934e2c1336e'
30         'SKIP'
31         'e88fcda77c0a6aaea0d83949cabbaaaf24f6a4b2324a14e459efc202b210c31b58f7a90c75c34ffd08911514b3b6db4be4423e3f8e0fb50b6d914da5be002319')
32 validpgpkeys=(
33   2DBF5BAA46FB4DED338A335BD65016F35352AA40  # Arnaldo Carvalho de Melo <acme@kernel.org>
36 prepare() {
37   cd dwarves-$pkgver
39   # https://bugs.archlinux.org/task/70013
40   patch -Np1 -i ../python.diff
43 build() {
44   local cmake_options=(
45     -DCMAKE_INSTALL_PREFIX=/usr
46     -DCMAKE_BUILD_TYPE=None
47     -D__LIB=lib
48   )
50   cmake -S dwarves-$pkgver -B build -G Ninja "${cmake_options[@]}"
51   cmake --build build
54 check() {
55   cd build
56   ctest --output-on-failure --stop-on-failure -j$(nproc)
59 _pick() {
60   local p="$1" f d; shift
61   for f; do
62     d="$srcdir/$p/${f#$pkgdir/}"
63     mkdir -p "$(dirname "$d")"
64     mv "$f" "$d"
65     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
66   done
69 package_pahole() {
70   depends=(
71     bash
72     libelf
73     zlib
74   )
75   optdepends=('ostra-cg: Generate call graphs from encoded traces')
76   provides=(libdwarves{,_emit,_reorganize}.so)
78   DESTDIR="$pkgdir" cmake --install build
80   _pick ostra "$pkgdir"/usr/{bin/ostra-cg,lib/python*}
83 package_ostra-cg() {
84   pkgdesc="Generate call graphs from encoded traces"
85   depends=(
86     pahole
87     python
88     python-matplotlib
89   )
91   mv ostra/* "$pkgdir"
93   python -m compileall -d /usr/lib "$pkgdir/usr/lib"
94   python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
97 # vim:set sw=2 sts=-1 et: