diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8cbccf1576..4014619f6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,6 +178,16 @@ jobs: for f in tools/linuxfs/overlay/usr/bin/* tools/linuxfs/overlay/usr/bin/steamos-polkit-helpers/*; do [ -f "$f" ] && install -Dm644 "$f" "$D/${f#tools/linuxfs/overlay/}" done + # The patched gamescope, when a build of it has been published (tools/gamescope/release.env + # names the release and the archive's sha256); see tools/gamescope/PATCHES.md. + if [ -f tools/gamescope/release.env ]; then + . tools/gamescope/release.env + curl -fsSL -o gamescope.tzst "https://github.com/${GITHUB_REPOSITORY}/releases/download/${GAMESCOPE_TAG}/gamescope.tzst" + echo "${GAMESCOPE_SHA256} gamescope.tzst" | sha256sum -c - + tar --use-compress-program=unzstd -xf gamescope.tzst -C "$D" + test -f "$D/usr/local/bin/gamescope" + rm gamescope.tzst + fi # And the desktop's launcher and labwc defaults, staged over the desktop package's copies. install -Dm644 tools/linuxfs/desktop/steamdeck-desktop "$D/usr/local/bin/steamdeck-desktop" install -Dm644 tools/linuxfs/desktop/autostart "$D/etc/xdg/labwc/autostart" diff --git a/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt b/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt index 66e05168fd..20c7c35e6a 100644 --- a/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt +++ b/app/src/main/java/com/steamdeck/launcher/session/SessionFiles.kt @@ -61,7 +61,16 @@ object SessionFiles { "etc/xdg/lxqt/panel.conf" to "etc/xdg/lxqt/panel.conf", "usr/lib/firefox/defaults/pref/steamdeck.js" to "usr/lib/firefox/defaults/pref/steamdeck.js", ) - val all = if (File(root, "usr/bin/labwc").isFile) files + desktop else files + // The patched gamescope (tools/gamescope): the runtime's own version rebuilt with the ARM64 + // client fixes, over /usr/local/bin so it comes first in the session's PATH. Only when the + // apk carries it - a build without the asset leaves the runtime's copy alone. + val optional = arrayOf( + "usr/local/bin/gamescope" to "usr/local/bin/gamescope", + ).filter { (asset, _) -> + val dir = asset.substringBeforeLast('/') + runCatching { context.assets.list("linuxfs/$dir")?.contains(asset.substringAfterLast('/')) == true }.getOrDefault(false) + } + val all = (if (File(root, "usr/bin/labwc").isFile) files + desktop else files) + optional for ((asset, relative) in all) { val target = File(root, relative) val staged = File(target.parentFile, target.name + ".staged") diff --git a/tools/linuxfs/overlay/usr/local/bin/bannerlator-session b/tools/linuxfs/overlay/usr/local/bin/bannerlator-session index 61702de282..eaba9e40e7 100755 --- a/tools/linuxfs/overlay/usr/local/bin/bannerlator-session +++ b/tools/linuxfs/overlay/usr/local/bin/bannerlator-session @@ -22,7 +22,7 @@ if [ -n "${BL_LOG:-}" ] && [ -z "${BL_INSIDE:-}" ]; then exec >>"$BL_LOG" 2>&1 echo "== bannerlator-session $(date) mode=$mode $*" echo "== uid=$(id -u) size=${BL_WIDTH:-?}x${BL_HEIGHT:-?} fps=${BL_FPS:-0} icd=${VK_ICD_FILENAMES:-none}" - echo "== gamescope: $(gamescope --version 2>&1 | head -1)" + echo "== gamescope: $(gamescope --version 2>&1 | head -1) at $(command -v gamescope)" echo "== rootfs: $(cat /.version 2>/dev/null || echo unversioned)" fi @@ -70,6 +70,10 @@ if [ -n "${BL_VK_DRIVER:-}" ]; then fi unset bl_icd_lib fi +# The app's gamescope build (tools/gamescope) takes realtime-priority Vulkan queues on this +# switch instead of on CAP_SYS_NICE, which proot never has; it falls back to normal priority +# where the driver refuses, and the runtime's own build ignores it. +export GAMESCOPE_FORCE_VULKAN_REALTIME=${BL_GAMESCOPE_REALTIME:-1} export XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config} export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}