# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kopeninghours
pkgver=25.04.2
pkgrel=0
pkgdesc="Library for parsing and evaluating OSM opening hours expressions"
url="https://invent.kde.org/libraries/kopeninghours"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="BSD-3-Clause AND CC0-1.0 AND LGPL-2.0-or-later"
makedepends="
	bison
	doxygen
	extra-cmake-modules
	flex
	graphviz
	kholidays-dev
	ki18n-dev
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/libraries/kopeninghours.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kopeninghours-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	# evaluatetest and iterationtest are broken
	ctest --test-dir build -E "(evaluate|iteration)test"
}

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

sha512sums="
0b6f00288cdb53e697752c50da42942a8eb7e98710623bac152407e4b491ee23aba059adcff467f6f4ff2c502b4690db7d7c6ca72cb1092b96bf64b3e4d0f483  kopeninghours-25.04.2.tar.xz
"
