# 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=keysmith
pkgver=25.04.2
pkgrel=0
pkgdesc="OTP client for Plasma Mobile and Desktop"
url="https://invent.kde.org/kde/keysmith"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
license="GPL-3.0-or-later"
depends="
	kirigami
	kirigami-addons
	prison
	"
makedepends="
	extra-cmake-modules
	kdbusaddons-dev
	ki18n-dev
	kirigami-dev
	libsodium-dev
	qqc2-desktop-style-dev
	qt6-qt5compat-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtdeclarative-private-dev
	qt6-qtsvg-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/utilities/keysmith.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/keysmith-$pkgver.tar.xz"

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

check() {
	local skipped_tests="account-(jobs-dispatcher-next|"
	local tests="
		storage-object-lifecycles
		storage-default-lifecycle
		storage-hotp-counter-update
		"
	for test in $tests; do
		skipped_tests="$skipped_tests|$test"
	done
	skipped_tests="$skipped_tests)"
	ctest --test-dir build -E "$skipped_tests"
}

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

sha512sums="
052393d33f063fd892a2ffa917427f6b842a6ef3115180921a26f51f935051f33cd05938bbbab2f3e0ee9c34abcd8b9182101d39952bc4e42c3a4d8c71437d37  keysmith-25.04.2.tar.xz
"
