main/postmarketos-ui-kodi: switch to GBM (MR 2808)

Kodi UI is broken on Wayland with Cage, switch to GBM instead.
GBM is more suitable for running standalone and easier to maintain.
Also add udev rules to automount USB drives as you cannot access
them from Kodi otherwise.

[ci:skip-build] already built successfully in CI
This commit is contained in:
Dylan Van Assche 2021-12-31 18:29:13 +01:00 committed by Clayton Craft
parent d1a6daca20
commit b24b021431
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
4 changed files with 33 additions and 20 deletions

View file

@ -1,29 +1,30 @@
# Reference: https://postmarketos.org/uipkg
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=postmarketos-ui-kodi
pkgver=1
pkgrel=7
pkgdesc="(Wayland) 10-foot UI useful on TV's"
pkgver=2
pkgrel=0
pkgdesc="(GBM) 10-foot UI useful on TV's"
url="https://kodi.tv"
arch="x86 x86_64 aarch64" # flatbuffers missing on armhf and armv7
license="GPL-3.0-or-later"
depends="
cage
elogind
kodi
kodi-wayland
kodi-gbm
kodi-polkit
postmarketos-base-ui
pulseaudio
tinydm
tinydm-openrc
upower
networkmanager
"
install="$pkgname.post-install $pkgname.post-upgrade"
source="kodi.desktop"
options="!check pmb:gpu-accel"
source="automount-media.rules"
package() {
install -Dm644 "$srcdir"/kodi.desktop \
"$pkgdir"/usr/share/wayland-sessions/kodi-wayland.desktop
install -Dm 644 automount-media.rules \
"$pkgdir"/usr/lib/udev/rules.d/99-automount-media.rules
}
sha512sums="fc7d545310a77845af88638e95a72f8774be4fb91231554ac91a2dfcd65d11aed5e6cea550548df5e12c49963968a17a89429fc0fb3ebf4a6843d95dccad7eee kodi.desktop"
sha512sums="
80de117c696854d45b5fca98a7ea975a103fedf483e1415c19060447673d15d3ee1fe7fcdb3f093821fdcb0fdb389af106638c7e6a39b33028dc4d176395f0e8 automount-media.rules
"

View file

@ -0,0 +1,19 @@
# Automount any media you plug into the device to make it accessible to Kodi
# Thanks to https://www.axllent.org/docs/auto-mounting-usb-storage/
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"
# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"
# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"
# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
# Exit
LABEL="media_by_label_auto_mount_end"

View file

@ -1,6 +0,0 @@
[Desktop Entry]
Name=Kodi (Wayland)
Comment=This session will start Kodi media center
Exec=cage -- /usr/bin/kodi --windowing wayland --standalone
TryExec=/usr/lib/kodi/kodi-wayland
Type=Application

View file

@ -1,6 +1,5 @@
#!/bin/sh
rc-update add tinydm default
rc-update add elogind default
rc-update add networkmanager default
tinydm-set-session -s /usr/share/wayland-sessions/kodi-wayland.desktop
rc-update add kodi default