# Reference: https://postmarketos.org/uipkg
# Maintainer: Newbyte <newbyte@postmarketos.org>
pkgname=postmarketos-ui-phosh
pkgver=22.3
pkgrel=7
pkgdesc="(Wayland) Mobile UI initially developed for the Librem 5"
url="https://phosh.mobi"
arch="noarch !armhf"
license="GPL-3.0-or-later"
depends="
	!gnome-shell-mobile
	!gnome-shell-mobile-schemas
	!mutter-mobile
	!mutter-mobile-schemas
	bluez
	gnome-keyring
	phosh
	postmarketos-base-ui-gnome
	postmarketos-base-ui-qt-tweaks
	postmarketos-base-ui-qt-wayland
	udiskie
	xdg-desktop-portal-wlr
	"
_pmb_recommends="
	calls
	chatty
	mobile-config-firefox
	phosh-mobile-settings
	portfolio
	postmarketos-default-camera
	postmarketos-tweaks
	postmarketos-welcome
	postprocessd
	ttyescape
	"
_pmb_groups="feedbackd"
install="$pkgname.post-install $pkgname.post-upgrade"
source="
	01_postmarketos-ui-phosh.gschema.override
	mimeapps.list
	udiskie.desktop
	"
options="!check pmb:gpu-accel pmb:systemd"
subpackages="$pkgname-openrc $pkgname-systemd"

package() {
	install -Dm644 "$srcdir"/01_postmarketos-ui-phosh.gschema.override \
		-t "$pkgdir"/usr/share/glib-2.0/schemas/
	install -Dm644 "$srcdir"/mimeapps.list \
		"$pkgdir"/usr/share/applications/mimeapps.list
	install -Dm644 "$srcdir"/udiskie.desktop \
		"$pkgdir"/etc/xdg/autostart/udiskie.desktop
}

openrc() {
	install_if="$pkgname=$pkgver-r$pkgrel openrc"
	install="$subpkgname.post-install"
	depends="
		tinydm
		tinydm-openrc
	"
	mkdir "$subpkgdir"
}

systemd() {
	install_if="$pkgname=$pkgver-r$pkgrel systemd"
	install="$subpkgname.post-install"
	depends="
		libcap-utils
		phosh-service
	"
	mkdir "$subpkgdir"
}

sha512sums="
e577b8073df680ccee75ef5b6bb1f2877d5727687d63d6fd9211298e791b6c9f593eb79278c77a4b4918e3c57333c2a012030baf5a3c8d6d16000cc63a030f84  01_postmarketos-ui-phosh.gschema.override
a741e8db9e4232334b924326c48be4e4c8f7a2382a7608926918a7491c518b2dda551e55a00d4d5fcf58c7950a78dc35d5cc5eaab53ad93a56de40887071f242  mimeapps.list
53f5c565b4ca8a12f12b63ec84a0194ef530703565d123203d41582a35a54d66afaf3a676df158ae0effe327dcfc1c6496a082ce9dbe803b2547417c3c3fad6e  udiskie.desktop
"
