# 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-plasma
pkgname=plasma-integration
pkgver=6.1.4
pkgrel=0
pkgdesc="Qt Platform Theme integration plugins for the Plasma workspace"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="(LGPL-2.1-only OR LGPL-3.0-only) AND LGPL-2.1-only AND ((LGPL-2.1-only WITH Nokia-Qt-exception-1.1) OR (GPL-3.0-only WITH Nokia-Qt-exception-1.1))"
depends="
	font-hack
	font-noto
	qqc2-breeze-style
	qqc2-desktop-style
	"
makedepends="
	breeze-dev
	extra-cmake-modules
	kconfig-dev
	kconfigwidgets-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	knotifications-dev
	kstatusnotifieritem-dev
	kwayland-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	libxcursor-dev
	plasma-wayland-protocols
	qt6-qtbase-dev
	samurai
	"
checkdepends="xvfb-run"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/plasma/plasma-integration.git"
source="https://download.kde.org/stable/plasma/$pkgver/plasma-integration-$pkgver.tar.xz"

build() {
	cmake -B build -DBUILD_QT5=OFF -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_DISABLE_FIND_PACKAGE_FontNotoSans=true \
		-DCMAKE_DISABLE_FIND_PACKAGE_FontHack=true
	cmake --build build
}

check() {
	xvfb-run -a ctest --test-dir build --output-on-failure -E "(qmltests6|frameworkintegration-k(deplatformtheme|fontsettingsdata|filedialog|hintssettings|filedialogqml)_unittest6)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
09276ecb1318aad8d89c95181cc4cee766f76384e143fac17006dbe72abdb105529fd71de3becfbe0f87c6a606574778b3da72065ce6b6d00ac141be2f8b664f  plasma-integration-6.1.4.tar.xz
"
