# Template file for 'cpptrace'
pkgname=cpptrace
version=1.0.4
revision=1
build_style=cmake
configure_args="-DCPPTRACE_BUILD_SHARED=ON -DCPPTRACE_USE_EXTERNAL_ZSTD=ON
 -DCPPTRACE_USE_EXTERNAL_LIBDWARF=ON -DCPPTRACE_FIND_LIBDWARF_WITH_PKGCONFIG=ON
 -DCPPTRACE_UNWIND_WITH_LIBUNWIND=ON"
hostmakedepends="pkg-config"
makedepends="libzstd-devel libdwarf-devel libunwind-devel"
checkdepends="gtest-devel"
short_desc="Stacktrace library for C++11 and newer"
maintainer="classabbyamp <void@placeviolette.net>"
license="MIT"
homepage="https://github.com/jeremy-rifkin/cpptrace/tree/main"
changelog="https://raw.githubusercontent.com/jeremy-rifkin/cpptrace/refs/heads/main/CHANGELOG.md"
distfiles="https://github.com/jeremy-rifkin/cpptrace/archive/refs/tags/v${version}.tar.gz"
checksum=5c9f5b301e903714a4d01f1057b9543fa540f7bfcc5e3f8bd1748e652e24f9ea

if [ "$XBPS_CHECK_PKGS" ] && [ -z "$CROSS_BUILD" ]; then
	configure_args+=" -DCPPTRACE_BUILD_TESTING=ON -DCPPTRACE_USE_EXTERNAL_GTEST=ON"
	CXXFLAGS="-DCPPTRACE_NO_TEST_SNIPPETS"
else
	configure_args+=" -DCPPTRACE_BUILD_TESTING=OFF"
fi

post_install() {
	vlicense LICENSE
}

cpptrace-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/cmake
		vmove "usr/lib/*.so"
	}
}
