# Forked to apply Plasma Mobile specific fixes that are not in a release yet
pkgname=plasma-workspace
pkgver=5.18.80
_pkgver=5.18.3
pkgrel=2
pkgdesc="KDE Plasma Workspace"
arch="all !armhf" # armhf blocked by kirigami2 -> qt5-qtdeclarative
url="https://www.kde.org/workspaces/plasmadesktop/"
license="(GPL-2.0-only OR GPL-3.0-only) AND LGPL-2.1-or-later AND GPL-2.0-or-later AND MIT AND LGPL-2.1-only AND LGPL-2.0-or-later AND (LGPL-2.1-only OR LGPL-3.0-only) AND LGPL-2.0-only"
depends="tzdata qt5-qtquickcontrols kirigami2 kinit qt5-qttools kwin kactivitymanagerd milou plasma-integration qtchooser kded kquickcharts"
depends_dev="plasma-framework-dev krunner-dev kjsembed-dev knotifyconfig-dev kdesu-dev knewstuff-dev kwallet-dev kidletime-dev kdeclarative-dev ki18n-dev kcmutils-dev ktextwidgets-dev kdelibs4support-dev kcrash-dev kglobalaccel-dev kdbusaddons-dev kwayland-dev kcoreaddons-dev kded-dev libksysguard-dev kpackage-dev kscreenlocker-dev phonon-dev zlib-dev kitemmodels-dev networkmanager-qt-dev baloo-dev ktexteditor-dev kwin-dev kholidays-dev prison-dev kpeople-dev kactivities-stats-dev libkscreen-dev gpsd-dev iso-codes-dev"
makedepends="$depends_dev extra-cmake-modules kdoctools-dev libxtst-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/plasma/$_pkgver/plasma-workspace-$_pkgver.tar.xz
	language-kcm-wrap-label-text.patch
	D27968.patch
	"
subpackages="$pkgname-dev $pkgname-libs $pkgname-doc $pkgname-lang"
builddir="$srcdir/$pkgname-$_pkgver"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	make -C build
}

check() {
	cd "$builddir"/build
	# nightcolortest requires running dbus
	# testdesktop is broken
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "(nightcolortest|testdesktop)"
}

package() {
	DESTDIR="$pkgdir" make -C build install
}
sha512sums="a0acc751e47f6b10753a41009e2b8d99bd901cbf667ce61fec04175c12d877f8dd3fe4a7f3d8f3ca18e126b72a00a59aed1edc33bc542e6e69fdf97af44eae1e  plasma-workspace-5.18.3.tar.xz
5628f61e702d332cbb87b8221a2b71e80bca1789026b82e74b1eaaa0a2f8438a705aac5ec99888239390753c81ec6a036acbf9ffad800987f08953cf6631adfe  language-kcm-wrap-label-text.patch
25aac2b2d8e10397e0eca2e79acb61785c48b316c3c6977d6258f33a1a05f47ea6de7c749b3cf8316c919ef67050bce379c8415addbd29695f8f3f4c35f22bd0  D27968.patch"
