maintainer="Bart Ribbers <bribbers@disroot.org>"
pkgname=kjournald
pkgver=25.04.2
pkgrel=1
pkgdesc="Framework for interacting with systemd-journald"
# armhf blocked by qt6-qtdeclarative and pmb#2618
arch="all !armhf"
url="https://invent.kde.org/system/kjournald"
license="BSD-3-Clause AND LGPL-2.1-or-later AND MIT"
depends_dev="
	kcoreaddons-dev
	kcrash-dev
	ki18n-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtdeclarative-private-dev
	systemd-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
_repo_url="https://invent.kde.org/system/kjournald.git"
source="https://download.kde.org/$_rel/release-service/$pkgver/src/kjournald-$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() {
	ctest --test-dir build -E "test_(viewmodel|filtercriteriamodel|remotejournal)"
}

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

sha512sums="
5f743d5f40f5703f2f442439e35f23dac5129c4453675912c6b83ca700193c7f4ca5cd147139c336a9216bb57a3bf2a9b2623e80c9ff115802a298544ad7aab9  kjournald-25.04.2.tar.xz
"
