main/postmarketos-ui-plasma-*: support openrc and systemd installs (MR 5171)

Co-authored-by: Clayton Craft <clayton@craftyguy.net>
This commit is contained in:
Bart Ribbers 2024-04-25 22:56:22 +02:00 committed by Clayton Craft
parent 7f16b13781
commit d0b1579cc7
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
21 changed files with 164 additions and 67 deletions

View file

@ -2,7 +2,7 @@
# Maintainer: Bart Ribbers <bribbers@disroot.org> # Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=postmarketos-base-ui-plasma pkgname=postmarketos-base-ui-plasma
pkgver=2 pkgver=2
pkgrel=1 pkgrel=2
pkgdesc="Meta package for shared configuration for Plasma-based UIs" pkgdesc="Meta package for shared configuration for Plasma-based UIs"
url="https://postmarketos.org" url="https://postmarketos.org"
arch="noarch !armhf" # armhf is not supported arch="noarch !armhf" # armhf is not supported
@ -12,28 +12,21 @@ depends="
bluez-openrc bluez-openrc
breeze breeze
dnsmasq dnsmasq
elogind
elogind-openrc
iio-sensor-proxy iio-sensor-proxy
iio-sensor-proxy-openrc
kscreen kscreen
kwallet-pam kwallet-pam
kwayland-integration kwayland-integration
modemmanager modemmanager
modemmanager-openrc
polkit-kde-agent-1 polkit-kde-agent-1
postmarketos-base-ui postmarketos-base-ui
postmarketos-base-ui-networkmanager postmarketos-base-ui-networkmanager
powerdevil powerdevil
pulseaudio pulseaudio
urfkill urfkill
urfkill-openrc
xdg-desktop-portal-kde xdg-desktop-portal-kde
" "
# Required to launch # Required to launch
depends="$depends depends="$depends
tinydm
tinydm-openrc
xorg-server xorg-server
" "
_pmb_recommends=" _pmb_recommends="
@ -50,7 +43,7 @@ _pmb_recommends="
postmarketos-artwork-wallpapers postmarketos-artwork-wallpapers
xdg-user-dirs xdg-user-dirs
" "
install="$pkgname.post-install $pkgname.post-upgrade" subpackages="$pkgname-openrc $pkgname-systemd"
source=" source="
gtk-app-wayland.sh gtk-app-wayland.sh
kdewallet.kwl kdewallet.kwl
@ -75,6 +68,25 @@ package() {
"$srcdir"/kdewallet.salt "$srcdir"/kdewallet.salt
} }
openrc() {
install_if="$pkgname=$pkgver-r$pkgrel openrc"
install="$subpkgname.post-install $subpkgname.post-upgrade"
depends="
elogind
elogind-openrc
iio-sensor-proxy-openrc
urfkill-openrc
"
mkdir -p "$subpkgdir"
}
systemd() {
install_if="$pkgname=$pkgver-r$pkgrel systemd"
install="$subpkgname.post-install $subpkgname.post-upgrade"
mkdir -p "$subpkgdir"
}
sha512sums=" sha512sums="
57793bb079c76ba3bdcfca7880aa887de11fe80e7a05557b78435e57feabab70fbaeedc42da3aec6f914c35bba8e8ee9918367516eb45ee247f63f694624f179 gtk-app-wayland.sh 57793bb079c76ba3bdcfca7880aa887de11fe80e7a05557b78435e57feabab70fbaeedc42da3aec6f914c35bba8e8ee9918367516eb45ee247f63f694624f179 gtk-app-wayland.sh

View file

@ -0,0 +1,8 @@
#!/bin/sh
rc-update add bluetooth default
rc-update add elogind default
rc-update add hfd-service default
rc-update add iio-sensor-proxy default
rc-update add networkmanager default
rc-update add urfkill default

View file

@ -0,0 +1 @@
postmarketos-base-ui-plasma-openrc.post-install

View file

@ -0,0 +1,7 @@
#!/bin/sh
systemctl enable bluetooth
#systemctl enable hfd-service
systemctl enable iio-sensor-proxy
#systemctl enable networkmanager
#systemctl enable urfkill

View file

@ -0,0 +1 @@
postmarketos-base-ui-plasma-systemd.post-install

View file

@ -1,22 +0,0 @@
#!/bin/sh
rc-update add bluetooth default
rc-update add elogind default
rc-update add hfd-service default
rc-update add iio-sensor-proxy default
rc-update add networkmanager default
rc-update add modemmanager default
rc-update add tinydm default
rc-update add urfkill default
# Migrate from the old ofono setup
if rc-update del ofono default; then
rc-update del ofono-auto-enable default
rc-service stop ofono
rc-service stop ofono-auto-enable
rc-service start modemmanager
fi
glib-compile-schemas /usr/share/glib-2.0/schemas

View file

@ -1 +0,0 @@
postmarketos-base-ui-plasma.post-install

View file

@ -2,7 +2,7 @@
# Maintainer: Bart Ribbers <bribbers@disroot.org> # Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=postmarketos-ui-plasma-desktop pkgname=postmarketos-ui-plasma-desktop
pkgver=3 pkgver=3
pkgrel=1 pkgrel=2
pkgdesc="(X11/Wayland) KDE Desktop Environment (works well with tablets)" pkgdesc="(X11/Wayland) KDE Desktop Environment (works well with tablets)"
url="https://www.kde.org" url="https://www.kde.org"
# armhf and riscv64 blocked by plasma # armhf and riscv64 blocked by plasma
@ -37,8 +37,8 @@ _pmb_recommends="$_pmb_recommends
wayland-utils wayland-utils
xdpyinfo xdpyinfo
" "
install="$pkgname.post-install $pkgname.post-upgrade" options="!check pmb:systemd" # No tests for a metapkg
options="!check" # No tests for a metapkg subpackages="$pkgname-openrc $pkgname-systemd"
package() { package() {
mkdir -p "$pkgdir" mkdir -p "$pkgdir"
@ -57,3 +57,17 @@ extras() {
mkdir -p "$subpkgdir" mkdir -p "$subpkgdir"
} }
openrc() {
install_if="$pkgname=$pkgver-r$pkgrel openrc"
install="$subpkgname.post-install $subpkgname.post-upgrade"
mkdir -p "$subpkgdir"
}
systemd() {
install_if="$pkgname=$pkgver-r$pkgrel systemd"
install="$subpkgname.post-install $subpkgname.post-upgrade"
mkdir -p "$subpkgdir"
}

View file

@ -8,6 +8,5 @@ if [ -f ${SDDM_CONF} ]; then
fi fi
fi fi
rc-update add modemmanager default
rc-update add sddm default rc-update add sddm default
rc-update add networkmanager default
rc-update add bluetooth default

View file

@ -0,0 +1 @@
postmarketos-ui-plasma-desktop-openrc.post-install

View file

@ -0,0 +1,11 @@
#!/bin/sh
SDDM_CONF=/etc/sddm.conf
if [ -f ${SDDM_CONF} ]; then
if ! grep -q "InputMethod" $SDDM_CONF; then
echo "InputMethod=qtvirtualkeyboard" >> $SDDM_CONF
fi
fi
systemctl enable sddm

View file

@ -0,0 +1 @@
postmarketos-ui-plasma-desktop-systemd.post-install

View file

@ -1 +0,0 @@
postmarketos-ui-plasma-desktop.post-install

View file

@ -2,7 +2,7 @@
# Maintainer: Bart Ribbers <bribbers@disroot.org> # Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=postmarketos-ui-plasma-mobile pkgname=postmarketos-ui-plasma-mobile
pkgver=5 pkgver=5
pkgrel=1 pkgrel=2
pkgdesc="(Wayland) Mobile variant of KDE Plasma (does not run without hardware acceleration)" pkgdesc="(Wayland) Mobile variant of KDE Plasma (does not run without hardware acceleration)"
url="https://wiki.postmarketos.org/wiki/Plasma_Mobile" url="https://wiki.postmarketos.org/wiki/Plasma_Mobile"
arch="noarch !armhf !x86" # armhf: pmaports#75, x86: aports#11807 arch="noarch !armhf !x86" # armhf: pmaports#75, x86: aports#11807
@ -29,15 +29,15 @@ _pmb_recommends="
spacebar spacebar
ttyescape ttyescape
" "
install="$pkgname.post-install $pkgname.post-upgrade"
source=" source="
plasma-mobile.service
kscreenlockerrc kscreenlockerrc
maliit-plasmamobile.json maliit-plasmamobile.json
org.kde.phone.homescreen.js org.kde.phone.homescreen.js
" "
subpackages="$pkgname-extras" subpackages="$pkgname-extras $pkgname-openrc $pkgname-systemd"
replaces="plasma-mobile" replaces="plasma-mobile"
options="!check pmb:gpu-accel" options="!check pmb:gpu-accel pmb:systemd"
package() { package() {
install -Dm644 \ install -Dm644 \
@ -72,8 +72,30 @@ extras() {
mkdir -p "$subpkgdir" mkdir -p "$subpkgdir"
} }
openrc() {
install_if="$pkgname=$pkgver-r$pkgrel openrc"
install="$subpkgname.post-install $subpkgname.post-upgrade"
depends="
modemmanager-openrc
tinydm
tinydm-openrc
"
mkdir -p "$subpkgdir"
}
systemd() {
install_if="$pkgname=$pkgver-r$pkgrel systemd"
install="$subpkgname.post-install $subpkgname.post-upgrade"
install -Dm644 "$srcdir"/plasma-mobile.service \
"$subpkgdir"/usr/lib/systemd/system/plasma-mobile.service
}
sha512sums=" sha512sums="
e12d8e98e28a795f879aebcceb32a991ee4abcb3bc5ec458aa5378bb52ff86cf39be04bc4a196925f532d623304b3005f561fa5e55d1c87944d718058ec4c0e6 plasma-mobile.service
b3aa8ee26c01de103c0c0af23532bf232f7071fdd02c53bd787d78e5974faa5662fc5776ce9be417392214ae73334b0eb0d073fe24f616a0ce99081f30b9158c kscreenlockerrc b3aa8ee26c01de103c0c0af23532bf232f7071fdd02c53bd787d78e5974faa5662fc5776ce9be417392214ae73334b0eb0d073fe24f616a0ce99081f30b9158c kscreenlockerrc
70ee87860842057b557a433a9ae7d54653f076a612b3d9de2d413d598806d23ec19390262eaa398cddf39437f1213d14922402a8d978878e5e98f3767ce0b9eb maliit-plasmamobile.json 70ee87860842057b557a433a9ae7d54653f076a612b3d9de2d413d598806d23ec19390262eaa398cddf39437f1213d14922402a8d978878e5e98f3767ce0b9eb maliit-plasmamobile.json
50dbb5e0b1550776ca6fc5b91468412b23d49aa502af77cf7d5d15af11eaf61b1632b205f42eac3274bf28a0b7b278a4d6bfc98c6c12ea29830fd258bad5107d org.kde.phone.homescreen.js 50dbb5e0b1550776ca6fc5b91468412b23d49aa502af77cf7d5d15af11eaf61b1632b205f42eac3274bf28a0b7b278a4d6bfc98c6c12ea29830fd258bad5107d org.kde.phone.homescreen.js

View file

@ -0,0 +1,58 @@
[Unit]
Description=Open-source user interface for phones, based on Plasma technologies
Documentation=https://invent.kde.org/plasma-mobile
# replaces the getty
Conflicts=getty@tty1.service
After=getty@tty1.service
# Needs all the dependencies of the services it's replacing
# (currently getty@tty1.service):
After=rc-local.service plymouth-quit-wait.service systemd-user-sessions.service
OnFailure=getty@tty1.service
# D-Bus is necessary for contacting logind. Logind is required.
Wants=dbus.socket
After=dbus.socket
# This scope is created by pam_systemd when logging in as the user.
# This directive is a workaround to a systemd bug, where the setup of the
# user session by PAM has some race condition, possibly leading to a failure.
# See README for more details.
After=session-c1.scope
# Since we are part of the graphical session, make sure we are started before
# it is complete.
Before=graphical.target
# Prevent starting on systems without virtual consoles
ConditionPathExists=/dev/tty0
[Service]
Environment=LANG=C.UTF-8
ExecStart=/usr/bin/startplasmamobile
TimeoutStartSec=30
User=10000
PAMName=login
WorkingDirectory=~
Restart=always
RestartSec=5s
# A virtual terminal is needed.
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
# Fail to start if not controlling the tty.
StandardInput=tty-fail
StandardOutput=journal
StandardError=journal
# Log this user with utmp, letting it show up with commands 'w' and 'who'.
UtmpIdentifier=tty7
UtmpMode=user
[Install]
WantedBy=graphical.target

View file

@ -0,0 +1,6 @@
#!/bin/sh
rc-update add modemmanager default
rc-update add tinydm default
tinydm-set-session -s /usr/share/wayland-sessions/plasma-mobile.desktop

View file

@ -0,0 +1 @@
postmarketos-ui-plasma-mobile-openrc.post-install

View file

@ -0,0 +1,3 @@
#!/bin/sh
systemctl enable plasma-mobile

View file

@ -0,0 +1 @@
postmarketos-ui-plasma-mobile-systemd.post-install

View file

@ -1,24 +0,0 @@
#!/bin/sh
rc-update add bluetooth default
rc-update add elogind default
rc-update add hfd-service default
rc-update add iio-sensor-proxy default
rc-update add networkmanager default
rc-update add modemmanager default
rc-update add tinydm default
rc-update add urfkill default
# Migrate from the old ofono setup
if rc-update del ofono default; then
rc-update del ofono-auto-enable default
rc-service stop ofono
rc-service stop ofono-auto-enable
rc-service start modemmanager
fi
tinydm-set-session -s /usr/share/wayland-sessions/plasma-mobile.desktop
glib-compile-schemas /usr/share/glib-2.0/schemas

View file

@ -1 +0,0 @@
postmarketos-ui-plasma-mobile.post-install