# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kcalendarcore
pkgver=6.13.0
pkgrel=0
pkgdesc="The KDE calendar access library"
# armhf blocked by qt6-qtdeclarative -> qt6-qttools
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later"
depends_dev="libical-dev"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	"
checkdepends="
	perl
	xcb-util-cursor
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-doc"
_repo_url="https://invent.kde.org/frameworks/kcalendarcore.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kcalendarcore-$pkgver.tar.xz"

replaces="kcalcore"

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

check() {
	xvfb-run ctest --test-dir build -E "test(dateserialization|memorycalendar|startdatetimesfordate|timesininterval|occurrenceiterator)"
}

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

sha512sums="
ee26898d70af6e34c83ba93b38c725ab0b655ec9004962ffbdf32e3690cc89662f575c3a6461971aa65a241ef8bf573bc163731971c002673eac6a068bcd7693  kcalendarcore-6.13.0.tar.xz
"
