# Reference: https://postmarketos.org/uipkg
# Maintainer: Jakko <jahau@rocketmail.com>
pkgname=postmarketos-ui-xfce4
pkgver=0.5.2
pkgrel=2
pkgdesc="(X11) Lightweight desktop (stylus recommended)"
url="https://gitlab.com/postmarketOS/xfce4-phone"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	bluez
	dnsmasq
	elogind
	elogind-openrc
	lightdm
	lightdm-openrc
	mesa-egl
	polkit-elogind
	postmarketos-base-ui
	postmarketos-base-ui-networkmanager
	xfce4
	xorg-server
	"
_pmb_recommends="
	alsa-plugins-pulse
	blueman
	faenza-icon-theme
	gnome-keyring
	greybird-themes
	network-manager-applet
	onboard
	pavucontrol
	pm-utils
	postmarketos-artwork-wallpapers
	unclutter-xfixes
	xfce4-notifyd
	xfce4-pulseaudio-plugin
	xfce4-screensaver
	xfce4-terminal
	xfce4-whiskermenu-plugin
	"
install="$pkgname.post-install $pkgname.post-upgrade"
source="
	xfce4-phone-$pkgver.tar.gz::https://gitlab.com/postmarketOS/xfce4-phone/-/archive/$pkgver/xfce4-phone-$pkgver.tar.gz
	10_onboard.gschema.override
	64-lightdm-autologin.conf
	enable-scrollbars.sh
	onboard-autostart.desktop
	unclutter-xfixes.desktop
	xfce4-phone.sh
	"
options="!check"
builddir="$srcdir/xfce4-phone-$pkgver"

package() {
	mkdir -p "$pkgdir"/etc/skel/.config
	cp -a "$builddir"/config/gtk-3.0 "$pkgdir"/etc/skel/.config/gtk-3.0

	mkdir -p "$pkgdir"/etc/xdg/xfce4-phone
	cp -a "$builddir"/config/xfce4 "$pkgdir"/etc/xdg/xfce4-phone/xfce4

	install -Dm644 "$srcdir"/10_onboard.gschema.override \
		"$pkgdir"/usr/share/glib-2.0/schemas/10_onboard.gschema.override

	install -Dm644 "$srcdir"/64-lightdm-autologin.conf \
		"$pkgdir"/usr/share/lightdm/lightdm.conf.d/64-autologin.conf

	install -Dm644 "$srcdir"/enable-scrollbars.sh \
		"$pkgdir"/etc/profile.d/enable-scrollbars.sh

	install -Dm644 "$srcdir"/onboard-autostart.desktop \
		"$pkgdir"/etc/xdg/xfce4-phone/autostart/onboard-autostart.desktop

	install -Dm644 "$srcdir"/unclutter-xfixes.desktop \
		"$pkgdir"/etc/xdg/xfce4-phone/autostart/unclutter-xfixes.desktop

	install -Dm644 "$srcdir"/xfce4-phone.sh \
		"$pkgdir"/etc/profile.d/xfce4-phone.sh
}

sha512sums="
a30b34fb87150810a291faa71726822942fc2b49e418fe3011445f7921b54bdf645e52ff61f31f61fbe799f221931f1d1a17f04b7378c2d72f4eb1795e5d78b7  xfce4-phone-0.5.2.tar.gz
114d77e6e7c11fc87244fc7c179244274c8f8711f111fcb1b9774ef6b226bd2bea01f85395da130f53670a870cfe571babd7f1c233ba85e1ef5a056ab65bd0b7  10_onboard.gschema.override
3841294daffdd3e0da5a7ba155ba8c21e9e5a2f2ba5b3b5ffa3ea6a16486625d3655d03f8c18740fcddfbca673c42a5289ec3b22720cfbbdd56fde8fdc3bf9b0  64-lightdm-autologin.conf
262cdcf334cfa56872797c960cb8683b79c7b13b0a8179cd002e598576f0e9fe07057fd0fe724e87a6664db4b91b31a8c0cbf026ab137533b07675f838ae57bb  enable-scrollbars.sh
ce7921f500b603796572bc02fa123e58d58ed1e9efd4d909de8f73c11a3e0bc0893639ce159f0701578b19db764893d021502d1c98cc24eb692e9d48320ff68c  onboard-autostart.desktop
b626c8b27d9418df15124d6e97f5174c173863536e9c3eebfb11473d764c81e1db40cf4b7cdabe44b67a0e295d920c7a849a3e2e40dd86402de8200242c7b05a  unclutter-xfixes.desktop
9ef0891cb1476c693175cf1ef8c64112354c1b2bf80c3cdfff4aabb2b9b9c434ccfa7dbdde3385fb215e94fc6216f3dc898be31b4ce9ad5bdb1c23bbb338d633  xfce4-phone.sh
"
