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

# 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=kauth
pkgver=6.8.0
pkgrel=0
pkgdesc="Abstraction to system policy and authentication features"
arch="all"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later"
depends_dev="
	kcoreaddons-dev
	kwindowsystem-dev
	polkit-qt-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/kauth.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kauth-$pkgver.tar.xz"

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

check() {
	# KAuthHelperTest hangs
	# KAuthFdTest is broken
	ctest --test-dir build --output-on-failure -E '(KAuthHelper|KAuthFd)Test'
}

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

sha512sums="
5a4bcd2eb54272db40557860283824a5c2904fe263325468c7a63c674514c46dd8ce723f42e4ce82eb3ca3e63b1b5a439f0d5b2457e7a0a3ef87154b76efec78  kauth-6.8.0.tar.xz
"
