# 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-pa
pkgver=6.1.4
pkgrel=0
pkgdesc="Plasma applet for audio volume management using PulseAudio"
# armhf blocked by qt6-qtdeclarative
# s390x blocked by plasma-workspace
arch="all !armhf !s390x"
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
	*.90*) _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/stable/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 --output-on-failure -E "applettest"
}

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

sha512sums="
00d46454f2091c9f0af809c03b7ecd19d2391d7b1f995ced91f49397a137523aaf7ce2844ec305069f0095a2dba73e5a163aa2ae05906a30f55946634ac5f3f9  plasma-pa-6.1.4.tar.xz
"
