[new_pkg] pahole

This commit is contained in:
Developer 2024-06-16 17:59:30 -04:00
parent da3d5a19ed
commit d642722cfc
2 changed files with 121 additions and 0 deletions

View File

@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Tue, 11 Jun 2024 23:57:52 +0200
Subject: [PATCH] CMakeLists.txt: Install ostra.py into Python3_SITELIB dir
Otherwise ostra-cg won't be able to find it. I'm not sure what
the "/usr/share/dwarves/runtime/python/" directory is supposed to be.
Signed-off-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ca1bf2173a7..ca997bc040c5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -188,7 +188,7 @@ install(FILES dwarves.h dwarves_emit.h dwarves_reorganize.h
install(FILES man-pages/pahole.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1/)
if(Python3_FOUND)
install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
- install(FILES ostra/python/ostra.py DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime/python)
+ install(FILES ostra/python/ostra.py DESTINATION ${Python3_SITELIB})
endif()
install(PROGRAMS btfdiff fullcircle DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(FILES lib/Makefile lib/ctracer_relay.c lib/ctracer_relay.h lib/linux.blacklist.cu

95
main/pahole/PKGBUILD Normal file
View File

@ -0,0 +1,95 @@
# Packager = Developer <dev@tuxcore.org>
pkgbase=pahole
pkgname=(
pahole
ostra-cg
)
pkgver=1.27
pkgrel=1
epoch=1
pkgdesc="Pahole and other DWARF utils"
url="https://git.kernel.org/pub/scm/devel/pahole/pahole.git"
arch=(x86_64)
license=(GPL-2.0-only)
makedepends=(
bash
cmake
glibc
libelf
ninja
python
python-matplotlib
zlib
)
source=(
https://fedorapeople.org/~acme/dwarves/dwarves-$pkgver.tar.{xz,sign}
0001-CMakeLists.txt-Install-ostra.py-into-Python3_SITELIB.patch
)
b2sums=('0a0f8ec8bf26240e17dc3319e76e16299514d662a79b25c4c962f723127f55d185d557adba7230d23b2e2b38fc62044aaa3474a458dc3df2000260637f995121'
'SKIP'
'02962095407cdbf191428884b83c3392e39d4acdad0c6a952655daec8b871bab8962c3716c9479192118eef81afe412203ac46600a2d702733254c6d7219f7d2')
2DBF5BAA46FB4DED338A335BD65016F35352AA40 # Arnaldo Carvalho de Melo <acme@kernel.org>
)
prepare() {
cd dwarves-$pkgver
# https://bugs.archlinux.org/task/70013
patch -Np1 -i ../0001-CMakeLists.txt-Install-ostra.py-into-Python3_SITELIB.patch
}
build() {
local cmake_options=(
-D CMAKE_INSTALL_PREFIX=/usr
-D CMAKE_BUILD_TYPE=None
-D __LIB=lib
)
cmake -S dwarves-$pkgver -B build -G Ninja "${cmake_options[@]}"
cmake --build build
}
check() {
ctest --test-dir build --output-on-failure --stop-on-failure -j$(nproc)
}
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
package_pahole() {
depends=(
bash
glibc
libelf
zlib
)
optdepends=('ostra-cg: Generate call graphs from encoded traces')
provides=(libdwarves{,_emit,_reorganize}.so)
DESTDIR="$pkgdir" cmake --install build
_pick ostra "$pkgdir"/usr/{bin/ostra-cg,lib/python*}
}
package_ostra-cg() {
pkgdesc="Generate call graphs from encoded traces"
depends=(
pahole
python
python-matplotlib
)
mv ostra/* "$pkgdir"
python -m compileall -d /usr/lib "$pkgdir/usr/lib"
python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
}
# vim:set sw=2 sts=-1 et: