# Template file for 'llvm-libunwind'
pkgname=llvm-libunwind
version=11.0.0
revision=1
build_style=cmake
wrksrc="libunwind-${version}.src"
hostmakedepends="llvm11"
makedepends="llvm11"
short_desc="LLVM version of libunwind library"
maintainer="Orphaned <orphan@voidlinux.org>"
license="NCSA, MIT"
homepage="https://llvm.org"
distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libunwind-${version}.src.tar.xz"
checksum=8455011c33b14abfe57b2fd9803fb610316b16d4c9818bec552287e2ba68922f

post_patch() {
	case "$XBPS_TARGET_MACHINE" in
		i686-musl|ppc-musl) ;;
		*) return 0 ;;
	esac
	vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' src/CMakeLists.txt
}

post_install() {
	vmkdir usr/include
	vcopy include/* usr/include
	vlicense LICENSE.TXT LICENSE
}

llvm-libunwind-devel_package() {
	short_desc+=" - development files"
	depends="${sourcepkg}>=${version}_${revision}"
	conflicts="libunwind-devel>=0"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
}
