# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=pugixml
pkgver=1.15
pkgrel=0
pkgdesc="Light-weight, simple and fast XML parser for C++ with XPath support"
url="https://pugixml.org"
arch="all"
license="MIT"
makedepends="cmake samurai"
subpackages="$pkgname-dev"
source="https://github.com/zeux/pugixml/archive/refs/tags/v$pkgver/pugixml-$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DPUGIXML_BUILD_TESTS="$(want_check && echo ON || echo OFF)"
	cmake --build build
}

check() {
	ctest --test-dir build
}

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

sha512sums="
b8a70f1f230b0902b719346ce0a551eafe534f81262280dceeb92d5ad90ea4e635173e08e225bf66eb5f4724ac4568bd40dc923f184571f02502dac49bc0b7f5  pugixml-1.15.tar.gz
"
