# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="team/kde <bribbers@disroot.org>"
pkgname=plasma-disks
pkgver=6.3.5
pkgrel=0
pkgdesc="Monitors S.M.A.R.T. capable devices for imminent failure"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://kde.org/plasma-desktop/"
license="GPL-2.0-or-later"
depends="
	kirigami
	smartmontools
	"
makedepends="
	extra-cmake-modules
	kauth-dev
	kcmutils-dev
	kcoreaddons-dev
	kdbusaddons-dev
	kdeclarative-dev
	ki18n-dev
	kio-dev
	knotifications-dev
	kservice-dev
	qt6-qtbase-dev
	samurai
	solid-dev
	"
checkdepends="xwayland-run"

case "$pkgver" in
	*.*.9*) _rel=unstable;;
	*) _rel=stable;;
esac

subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/plasma/plasma-disks.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/plasma-disks-$pkgver.tar.xz"

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

check() {
	wlheadless-run -- ctest --test-dir build
}

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

sha512sums="
2ed3592aede4f9e4303a64cd7f5ccac269e010b70189e5c29d3c6bf22dba99b294aebb1580736733f68c56e9854a72144a343c6586acf3ddaf42c4809e2d083e  plasma-disks-6.3.5.tar.xz
"
