build: add kde plasma shell package script and smoke test

This commit is contained in:
xXJsonDeruloXx committed 2026-09-28 18:52:39 -04:00
1 parent d8d375cb9a
commit 8a859ad6b9
4 files changed
+130

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
#!/bin/bash
# Builds the KDE Plasma shell package: the closure of seeds.txt over Arch Linux ARM, as a zstd
# tarball that extracts over the rootfs, with the desktop package (LXQt) already in it.
#
# The closure and extraction are winlator-contents' own desktop/build-pkg.sh, pinned below, so this
# package is made exactly like the desktop one. What it leaves out is the runtime's packages (as the
# desktop does) plus the desktop package's - except Qt and the KDE libraries, which are shipped
# again: KWin and plasmashell use Qt's private API and must match the Qt they were built against.
#
# tools/plasma/build.sh <out dir>
#
# Needs curl, git, tar, zstd, python3.
set -euo pipefail
out=${1:?out dir}
here=$(cd "$(dirname "$0")" && pwd)
. "$here/release.env"
work=$(mktemp -d)
mkdir -p "$out"
git init -q "$work/contents"
git -C "$work/contents" fetch -q --depth 1 https://github.com/The412Banner/winlator-contents.git "$CONTENTS_REF"
git -C "$work/contents" checkout -q FETCH_HEAD
curl -fsSL --retry 6 --retry-delay 5 --retry-all-errors -o "$work/desktop.packages.txt" "$DESKTOP_PACKAGES_URL"
# Package names from the desktop's file list (name-pkgver-pkgrel-arch.pkg.tar.xz); the ones Plasma
# must bring in its own build are not counted as present.
python3 - "$work/desktop.packages.txt" > "$work/desktop-names.txt" <<'PY'
import re, sys
keep = re.compile(r"^(qt6-|layer-shell-qt|kf6-|kwayland|plasma|breeze|kde|libplasma|kirigami|kpipewire|kscreenlocker|kglobalacc)")
for line in open(sys.argv[1]):
line = line.strip()
if not line: continue
name = line.rsplit("-", 3)[0]
if not keep.match(name): print(name)
PY
cat "$work/contents/desktop/base-packages.txt" "$work/desktop-names.txt" | sort -u > "$work/present.txt"
echo "== plasma: $(wc -l < "$work/present.txt") packages counted as present (runtime + desktop, less Qt/KDE)"
bash "$work/contents/desktop/build-pkg.sh" plasma "$here/seeds.txt" "$work/present.txt" "$out"
# What this package replaces from the desktop's: printed so a Qt bump is never a surprise.
python3 - "$work/desktop.packages.txt" "$out/plasma.packages.txt" <<'PY'
import sys
def names(p): return {l.strip().rsplit("-", 3)[0]: l.strip() for l in open(p) if l.strip()}
d, p = names(sys.argv[1]), names(sys.argv[2])
for n in sorted(set(d) & set(p)):
if d[n] != p[n]: print("== replaces", d[n], "->", p[n])
PY
rm -rf "$work"
+9
View File
@@ -0,0 +1,9 @@
# What the Plasma package is built on and tested against.
# winlator-contents at the commit whose desktop/build-pkg.sh and base-packages.txt are used.
CONTENTS_REF=843e9c7dcdf52260993ee9f23c33a2e17acb5e20
DESKTOP_PACKAGES_URL=https://github.com/The412Banner/winlator-contents/releases/download/steamdeck-desktop-r1/desktop.packages.txt
# The runtime and desktop package the smoke test installs it over (linuxfs.json, desktop.json).
RUNTIME_URL=https://github.com/The412Banner/winlator-contents/releases/download/linuxfs-r9/linuxfs.tar.zst
RUNTIME_SHA256=d3240c1531531615b0dd06b6ad56e92db9015a8641eb18c3a613835ae45992e7
DESKTOP_URL=https://github.com/The412Banner/winlator-contents/releases/download/steamdeck-desktop-r1/desktop.tar.zst
DESKTOP_SHA256=c2bb860b3b1688287451e2495be5db313ec07f8c8af501dfac2768a9f417bc86
+15
View File
@@ -0,0 +1,15 @@
# KDE Plasma as a second desktop shell: KWin nested as a client of the app's compositor, with
# plasmashell's panel and desktop on it. Installed over the desktop package (LXQt), which keeps
# Xwayland, Firefox, mpv and the launchers; this only adds the shell and its everyday apps.
# One package name per line; the closure over Arch Linux ARM is taken at build time.
kwin
plasma-workspace
plasma-desktop
plasma-pa
breeze
breeze-icons
kde-cli-tools
xdg-desktop-portal-kde
systemsettings
dolphin
konsole
+56
View File
@@ -0,0 +1,56 @@
#!/bin/bash
# Installs the Plasma package the way the app does - runtime, then the desktop package, then this
# one, each extracted over the last - and checks that its programs load in that rootfs: every
# library they link resolves (with the runtime's glibc), and KWin and plasmashell start far enough
# to print their versions. Runs on an arm64 host; needs sudo for chroot.
#
# tools/plasma/smoke-test.sh <plasma.tar.zst>
set -euo pipefail
pkg=$(realpath "${1:?plasma.tar.zst}")
here=$(cd "$(dirname "$0")" && pwd)
. "$here/release.env"
work=$(mktemp -d)
root=$work/root
mkdir -p "$root"
fetch() { # url sha256 out
curl -fsSL --retry 6 --retry-delay 5 --retry-all-errors -o "$3" "$1"
echo "$2 $3" | sha256sum -c -
}
fetch "$RUNTIME_URL" "$RUNTIME_SHA256" "$work/runtime.tar.zst"
fetch "$DESKTOP_URL" "$DESKTOP_SHA256" "$work/desktop.tar.zst"
for t in "$work/runtime.tar.zst" "$work/desktop.tar.zst" "$pkg"; do
sudo tar --zstd -xf "$t" -C "$root"
done
rm -f "$work/runtime.tar.zst" "$work/desktop.tar.zst"
fail=0
for bin in usr/bin/kwin_wayland usr/bin/plasmashell usr/bin/dolphin usr/bin/konsole usr/bin/systemsettings; do
[ -e "$root/$bin" ] || { echo "MISSING /$bin"; fail=1; }
done
ls "$root"/usr/lib/startplasma-waylandsession "$root"/usr/lib*/libexec/startplasma-waylandsession 2>/dev/null \
|| echo "note: no startplasma-waylandsession; the launcher starts plasmashell itself"
# Every ELF the package added, checked with the rootfs's own loader.
tar --zstd -tf "$pkg" | sed -n 's#^\./##; /^usr\/\(bin\|lib\)\/.*[^/]$/p' > "$work/files.txt"
: > "$work/unresolved.txt"
while read -r f; do
[ -f "$root/$f" ] && [ ! -L "$root/$f" ] || continue
head -c 4 "$root/$f" | grep -q $'\x7fELF' || continue
sudo chroot "$root" /usr/bin/ldd "/$f" 2>&1 | grep -E "not found" | sed "s#^#/$f: #" >> "$work/unresolved.txt" || true
done < "$work/files.txt"
if [ -s "$work/unresolved.txt" ]; then
echo "== unresolved libraries or symbol versions:"
sort -u "$work/unresolved.txt" | head -80
fail=1
else
echo "== every library in the package resolves in the runtime"
fi
for prog in kwin_wayland plasmashell; do
if sudo chroot "$root" /usr/bin/env -i PATH=/usr/bin HOME=/root QT_QPA_PLATFORM=offscreen "/usr/bin/$prog" --version; then :; else
echo "FAILED: $prog --version"; fail=1
fi
done
sudo rm -rf "$work"
exit $fail