# Template file for 'libpdal'
pkgname=libpdal
version=2.7.1
revision=1
build_style=cmake
build_helper="qemu"
hostmakedepends="pkg-config"
makedepends="libcurl-devel libgdal-devel libgeotiff-devel libunwind-devel
 libxml2-devel proj-devel python3-devel tiff-devel zlib-devel"
checkdepends="libgdal-tools"
short_desc="Point Data Abstraction Library"
maintainer="Arjan Mossel <arjanmossel@gmail.com>"
license="BSD-3-Clause"
homepage="https://pdal.io/"
distfiles="https://github.com/PDAL/PDAL/releases/download/${version}/PDAL-${version}-src.tar.gz"
checksum=5e5ac8b5d11ae4dbbde1b5af2ae097b13ed9ed67a57ad942b2c7704d0190c705

do_check() {
	cd build
	case "$XBPS_TARGET_MACHINE" in
		i686*) ctest -E \
			"pdal_(app_plugin|file_utils|filters_colorinterp|filters_stats|io_optech|utils)_test" ;;
		x86_64*) ctest -E 'pdal_app_plugin_test' ;;
		*) ctest ;;
	esac
}

post_install() {
	vlicense LICENSE.txt
}

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