# Reference: https://postmarketos.org/uipkg
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=postmarketos-ui-plasma-mobile
pkgver=4
pkgrel=0
pkgdesc="(Wayland) Mobile variant of KDE Plasma (does not run without hardware acceleration)"
url="https://wiki.postmarketos.org/wiki/Plasma_Mobile"
arch="noarch !armhf !x86" # armhf: pmaports#75, x86: aports#11807
license="GPL-3.0-or-later"
depends="
	callaudiod
	hfd-service
	plasma-mobile
	postmarketos-base-ui-plasma
	"
_pmb_recommends="
	angelfish
	index
	kclock
	koko
	plasma-dialer
	plasma-mobile-sounds
	plasma-phonebook
	postmarketos-default-camera
	postprocessd
	qmlkonsole
	spacebar
	ttyescape
	"
install="$pkgname.post-install $pkgname.post-upgrade"
source="
	maliit-plasmamobile.json
	org.kde.phone.homescreen.js
	"
subpackages="$pkgname-extras"
replaces="plasma-mobile"
options="!check pmb:gpu-accel"

package() {
	install -Dm644 "$srcdir"/maliit-plasmamobile.json \
		"$pkgdir"/usr/share/maliit/keyboard2/devices/plasmamobile.json

	install -Dm644 "$srcdir"/org.kde.phone.homescreen.js \
		"$pkgdir"/usr/share/plasma/look-and-feel/org.kde.plasma.phone/contents/plasmoidsetupscripts/org.kde.phone.homescreen.js
}

extras() {
	pkgdesc="Meta package for additional Plasma mobile apps"
	_pmb_recommends="
		alligator
		buho
		calindori
		elisa
		kaidan
		kalk
		kasts
		kdeconnect
		keysmith
		kongress
		krecorder
		ktrip
		kweather
		neochat
		nota
		okular-mobile
		tokodon
		vvave
		"

	mkdir -p "$subpkgdir"
}


sha512sums="
70ee87860842057b557a433a9ae7d54653f076a612b3d9de2d413d598806d23ec19390262eaa398cddf39437f1213d14922402a8d978878e5e98f3767ce0b9eb  maliit-plasmamobile.json
50dbb5e0b1550776ca6fc5b91468412b23d49aa502af77cf7d5d15af11eaf61b1632b205f42eac3274bf28a0b7b278a4d6bfc98c6c12ea29830fd258bad5107d  org.kde.phone.homescreen.js
"