# 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-pa
pkgver=6.3.5
pkgrel=0
pkgdesc="Plasma applet for audio volume management using PulseAudio"
# 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 GPL-2.0-only"
depends="
	kirigami
	kquickcharts
	pulseaudio
	"
makedepends="
	extra-cmake-modules
	kcmutils-dev
	kcoreaddons-dev
	kdeclarative-dev
	kdoctools-dev
	kglobalaccel-dev
	ki18n-dev
	knotifications-dev
	kstatusnotifieritem-dev
	ksvg-dev
	libcanberra-dev
	libplasma-dev
	plasma-workspace-dev
	pulseaudio-qt-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	samurai
	"

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

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

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

check() {
	# applettest requires Selenium
	ctest --test-dir build -E "applettest"
}

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

sha512sums="
0e7f2bf71d6f7d6a7f720fe8d2172188adf568b96d69bd1c7c632c581f258cf896e6031742694728edeb69164abfdf25d1078dbcbadbf8520f5f0d46c199394e  plasma-pa-6.3.5.tar.xz
"
