# Template file for 'libsigsegv'

pkgname="libsigsegv"
version="2.11"
revision=1
build_style=gnu-configure
short_desc="Handling page faults in user mode"
maintainer="Martin Riese <grauehaare@gmx.de>"
license="GPL-2"
homepage="http://www.gnu.org/software/libsigsegv/"
distfiles="http://ftpmirror.gnu.org/libsigsegv/libsigsegv-${version}.tar.gz"
checksum=dd7c2eb2ef6c47189406d562c1dc0f96f2fc808036834d596075d58377e37a18
configure_args="--enable-shared"

post_configure() {
	case "$XBPS_TARGET_MACHINE" in
	arm*-musl)
		# Avoid double include of signal.h
		sed -e "s;#define HAVE_SYS_SIGNAL_H 1;#undef HAVE_SYS_SIGNAL_H;" \
			-i ${wrksrc}/config.h
		# struct sigcontext already defined through sigsegv.h
		sed -e "s;#include <asm/sigcontext.h>;;" \
			-i ${wrksrc}/src/fault-linux-arm-old.h
	esac
}
libsigsegv-devel_package() {
	short_desc+=" - development files"
	depends="${sourcepkg}>=${version}_${revision}"
	pkg_install () {
		vmove usr/include
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
}
