# Contributor: Alex Yam <alex@alexyam.com>
# Maintainer: Alex Yam <alex@alexyam.com>
pkgname=libspatialindex
pkgver=0_git20210205
_commit=8ee223632f95c81f49f5eb2d547ad973475c4601
pkgrel=1
pkgdesc="extensible framework for robust spatial indexing methods"
url="https://libspatialindex.org/"
arch="all"
license="MIT"
makedepends="cmake"
subpackages="$pkgname-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/libspatialindex/libspatialindex/archive/$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_PREFIX_PATH=/usr \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_TESTING=ON
	cmake --build build
}

check() {
	cd build && ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="caf91aac77b75445e4fc4d0baedcd10c619b2097dfd841b00339d9ddd4b73db05b99de1d84be88f1083f4713a936cf110d5851523491f5a74c6f96e1d5795dbb  libspatialindex-8ee223632f95c81f49f5eb2d547ad973475c4601.tar.gz"
