# Template file for 'libucontext'
pkgname=libucontext
version=1.5
revision=1
archs="*-musl"
build_style=meson
hostmakedepends="pkg-config scdoc"
short_desc="Compatibility layer providing ucontext functions"
maintainer="Orphaned <orphan@voidlinux.org>"
license="ISC"
homepage="https://github.com/kaniini/libucontext"
changelog="https://raw.githubusercontent.com/kaniini/libucontext/master/NEWS"
distfiles="https://github.com/kaniini/libucontext/archive/refs/tags/libucontext-${version}.tar.gz"
checksum=b3ca8d7d3e5c926a90ddb691f8a52ccb364069a745304a40c29f3b0d39b80c93

case "$XBPS_TARGET_MACHINE" in
	x86_64*) _cpu=x86_64 ;;
	i686*) _cpu=x86 ;;
	powerpc64*|ppc64*) _cpu=ppc64 ;;
	powerpc*|ppc*) _cpu=ppc ;;
	mips*64*) _cpu=mips64 ;;
	mips*) _cpu=mips ;;
	aarch64*) _cpu=aarch64 ;;
	arm*) _cpu=arm ;;
	riscv64*) _cpu=riscv64 ;;
	s390x*) _cpu=s390x ;;
	*) broken="Unknown libucontext arch" ;;
esac

configure_args="-Ddocs=true -Dcpu=$_cpu"

post_install() {
	vlicense LICENSE
}

libucontext-devel_package() {
	depends="libucontext>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
		vmove "usr/lib/*.a"
		vmove usr/share/man
	}
}
