void-packages/srcpkgs/crash/template
2018-05-19 16:59:03 +02:00

46 lines
1.3 KiB
Bash

# Template file for 'crash'
pkgname=crash
version=7.2.3
revision=1
build_style=gnu-makefile
hostmakedepends="flex"
makedepends="lzo-devel ncurses-devel zlib-devel"
short_desc="Kernel crash dump debugger and live inspector"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-3.0-or-later"
homepage="http://people.redhat.com/anderson/"
#changelog="https://people.redhat.com/anderson/crash.changelog.html"
distfiles="http://people.redhat.com/anderson/${pkgname}-${version}.tar.gz"
checksum=d34d4e3962bd8ef786e6fa4933105ae9049f052aaa2afce45492e2bd78a66112
only_for_archs="i686 x86_64" # broken on musl
nocross=yes
LDFLAGS=-llzo2
case "$XBPS_TARGET_MACHINE" in
i686*) nopie=yes;; # broken CPUID inline assembly
esac
post_extract() {
sed -i 's|arch|uname -a|g' extensions/snap.mk
sed -i 's|/usr/lib/debug/lib/modules|/usr/lib/debug/usr/lib/modules|g' defs.h
sed -i 's|/boot/efi/redhat|/usr/lib/debug/boot/|g' filesys.c
sed -i '/^LDFLAGS=/d' Makefile
}
do_build() {
make gdb_unzip
sed -i 's|sys/debugreg.h|asm/debugreg.h|g' gdb-7.6/gdb/amd64-linux-nat.c
sed -i 's|const struct ps_prochandle|struct ps_prochandle|g' gdb-7.6/gdb/*.c
make ${makejobs} lzo
make ${makejobs} extensions
}
do_install() {
vbin crash
vman crash.8
vmkdir usr/lib/crash/extensions
for f in extensions/*.so; do
vinstall $f 0644 usr/lib/crash/extensions
done
}