# 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=zanshin
pkgver=25.04.2
pkgrel=0
pkgdesc="A Getting Things Done application which aims at getting your mind like water"
# armhf blocked by qt6-qtdeclarative
# armv7, ppc64le and s390x blocked by qt6-qtwebengine -> akonadi-calendar
# loongarch64 blocked by akonadi-calendar
arch="all !armhf !armv7 !ppc64le !s390x !riscv64 !loongarch64"
url="https://zanshin.kde.org/"
license="(GPL-2.0-only OR GPL-3.0-only) AND LGPL-2.0-or-later"
makedepends="
	akonadi-calendar-dev
	boost-dev
	extra-cmake-modules
	ki18n-dev
	kontactinterface-dev
	krunner-dev
	kwindowsystem-dev
	qt6-qtbase-dev
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/pim/zanshin.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/zanshin-$pkgver.tar.xz"

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

check() {
	local skipped_tests="tests-units-(widgets-pageview"
	local tests="
		akonadi-akonadi(serializer|storage|cachingstorageintegration)
		compositejob
		migrator-zanshin(021migration|contextitemsmigration)
		"
	for test in $tests; do
		skipped_tests="$skipped_tests|$test"
	done
	skipped_tests="$skipped_tests)test"
	xvfb-run ctest --test-dir build -E "$skipped_tests"
}

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

sha512sums="
701a5d78b83f1c9cafa0520bced65e87611c89f11689da8c8428cbed9125b51d98cc057fb988f99c7c7c9aba15602eebc979226954bdb3f6becba309aca81702  zanshin-25.04.2.tar.xz
"
