# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=kirigami-addons
pkgver=1.4.0
pkgrel=0
pkgdesc="Add-ons for the Kirigami framework"
url="https://invent.kde.org/libraries/kirigami-addons"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="LGPL-2.0-or-later AND GPL-2.0-or-later"
depends="
	kirigami
	qt6-qtmultimedia
	"
makedepends="
	extra-cmake-modules
	kglobalaccel-dev
	kguiaddons-dev
	ki18n-dev
	kirigami-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/libraries/kirigami-addons.git"
source="https://download.kde.org/stable/kirigami-addons/kirigami-addons-$pkgver.tar.xz"

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

check() {
	# tst_sounds.qml is broken
	xvfb-run -a ctest --test-dir build --output-on-failure -E "tst_(sounds|avatar|album_(qmllist|abstractlist|qmlqobject)model).qml"
}

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

sha512sums="
f9c44436c0b5360fba702cb3ef0a5445d96f4fef023ad74db1ff07cdb362c41e8ab7bfd779cf021bae9578f9d07245ab56c80e243d1b6af70c5d12c5afcbc8b2  kirigami-addons-1.4.0.tar.xz
"
