# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=grantlee
pkgver=5.3.1
pkgrel=0
pkgdesc="A string template engine based on the Django template system and written in Qt5"
arch="all"
url="https://github.com/steveire/grantlee"
license="LGPL-2.1-or-later"
depends_dev="
	graphviz-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtscript-dev
	"
makedepends="$depends_dev
	cmake
	doxygen
	graphviz
	samurai
	"
checkdepends="xvfb-run"
source="https://github.com/steveire/grantlee/releases/download/v$pkgver/grantlee-$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-doc"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
	ninja -C build docs
}

check() {
	cd build

	# testfilters is broken
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "test(filters|builtins)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
	install -Dm644 build/apidox/* -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
dc7192fe0553954fffc3e2c584e4fdd80fc1f22d25846cacc5f2dcd1db2673ca62464c8492a4ed3bfc9dfc3e62ef13322809dd29bd56fa4a3a153a8d373ddde5  grantlee-5.3.1.tar.gz
"
