From 4b09b44aa937e95767fb49fbf798cfa9b983e3de Mon Sep 17 00:00:00 2001 From: Tamas Csikel Date: Sun, 25 Oct 2026 14:11:49 +0100 Subject: [PATCH] Add Store support and unsigned app releases --- app.toml | 21 ++++++++++ bin/smartfox-steam | 24 +++++++++++ package.sh | 81 ++++++++++++++++++++++++++++++++++++++ valve-archive-keyring.gpg | Bin 0 -> 2768 bytes 4 files changed, 126 insertions(+) create mode 100644 app.toml create mode 100644 bin/smartfox-steam create mode 100644 package.sh create mode 100644 valve-archive-keyring.gpg diff --git a/app.toml b/app.toml new file mode 100644 index 0000000..099a221 --- /dev/null +++ b/app.toml @@ -0,0 +1,21 @@ +id = "steam" +name = "Steam" +# Set by tools/pkg/steam/package.sh to the official steam-launcher version: +# the package (sf-app-steam) is rebuilt whenever Valve releases a new one. +version = "0.0.0" +kind = "exec" +category = "Játékok" +description = "A hivatalos Steam kliens, kontrollerrel kezelhető Big Picture felülettel. Az első indításkor letölti magát, ez néhány percig tart." +# gamescope (Valve's own compositor, as on the Steam Deck) hosts the X11 +# Steam client and the games, and scales them to the TV. +exec = ["bin/smartfox-steam"] +icon = "steam" +accent = "#66C0F4" +palette = ["#66c0f4", "#1b4f7a", "#060b12"] +order = 25 + +[sandbox] +# Steam runs its games in its own container (pressure-vessel), nested in +# this sandbox. Its data, games included, are in the app's data folder +# (~/.local/share/smartfox/apps/steam). +permissions = ["network", "gpu", "audio", "gamepad", "dbus-session"] diff --git a/bin/smartfox-steam b/bin/smartfox-steam new file mode 100644 index 0000000..18699f4 --- /dev/null +++ b/bin/smartfox-steam @@ -0,0 +1,24 @@ +#!/bin/sh +# Starts the official Steam client (steam/, from Valve's steam-launcher +# package) in its gamepad UI, inside gamescope: the client and the games are +# X11 programs, gamescope gives them an X server and shows them as one +# Wayland window on the TV. +# +# Output: the TV's current mode. Games render at most at 1080p (an N100 can't +# do 4K) and gamescope scales them up. +APP="${SMARTFOX_APP_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" + +mode=$(wlr-randr 2>/dev/null | awk '/current/ {print $1; exit}') +W=${mode%x*} +H=${mode#*x} +case "$W:$H" in + *[!0-9:]* | :* | *:) W=1920 H=1080 ;; +esac +GW=$W GH=$H +if [ "$H" -gt 1080 ]; then + GW=$((W * 1080 / H)) + GH=1080 +fi + +GAMESCOPE=$(command -v gamescope || echo /usr/games/gamescope) +exec "$GAMESCOPE" -e -f -W "$W" -H "$H" -w "$GW" -h "$GH" -- "$APP/steam/steam" -gamepadui "$@" diff --git a/package.sh b/package.sh new file mode 100644 index 0000000..5adcace --- /dev/null +++ b/package.sh @@ -0,0 +1,81 @@ +#!/usr/bin/env bash +# The Steam app from Valve's official package: downloads the newest +# steam-launcher .deb from repo.steampowered.com, checks it against Valve's +# signed repository index, and puts the launcher into an app folder. +# +# package.sh --version prints the newest official version (1.0.0.87) +# package.sh fills (a copy of apps/steam) and sets the +# version in its app.toml +# +# Used by tools/pkg/packages.sh (the sf-app-steam package, so Steam updates +# like every other app) and image/build.sh (the preinstalled factory copy). +# +# Trust: valve-archive-keyring.gpg is the keyring from the steam-launcher +# package itself (Valve Corporation, BA18 16EF 8E75 005F CF5E 27A1 F24A EA9F +# B054 98B7, and the 2025 repository key). InRelease must be signed by it, the +# Packages index must match its SHA256, the .deb must match the index. +set -euo pipefail + +HERE="$(cd "$(dirname "$0")" && pwd)" +REPO="${STEAM_REPO:-https://repo.steampowered.com/steam}" +KEYRING="$HERE/valve-archive-keyring.gpg" +TMP=$(mktemp -d) +trap 'rm -rf "$TMP"' EXIT + +curl -fsSL -o "$TMP/InRelease" "$REPO/dists/stable/InRelease" +if ! gpgv --keyring "$KEYRING" --output "$TMP/Release" "$TMP/InRelease" 2>"$TMP/gpgv.log"; then + cat "$TMP/gpgv.log" >&2 + echo "steam: InRelease is not signed by Valve's key" >&2 + exit 1 +fi +want=$(awk '/^SHA256:/ {f = 1; next} /^[^ ]/ {f = 0} f && $3 == "steam/binary-amd64/Packages" {print $1}' "$TMP/Release") +[ -n "$want" ] || { echo "steam: no Packages checksum in Release" >&2; exit 1; } +curl -fsSL -o "$TMP/Packages" "$REPO/dists/stable/steam/binary-amd64/Packages" +echo "$want $TMP/Packages" | sha256sum -c --quiet - || { echo "steam: Packages checksum mismatch" >&2; exit 1; } + +# The newest steam-launcher in the index: "versionfilenamesha256". +best=$(awk -v RS= -v FS='\n' ' + $0 ~ /(^|\n)Package: steam-launcher(\n|$)/ { + v = f = s = "" + for (i = 1; i <= NF; i++) { + if ($i ~ /^Version: /) v = substr($i, 10) + if ($i ~ /^Filename: /) f = substr($i, 11) + if ($i ~ /^SHA256: /) s = substr($i, 9) + } + sub(/^[0-9]+:/, "", v) + print v "\t" f "\t" s + }' "$TMP/Packages" | sort -t "$(printf '\t')" -k1,1V | tail -1) +IFS=$'\t' read -r version file sha <<<"$best" +case "$version" in + "" | *[!0-9.]*) echo "steam: unexpected version '$version'" >&2; exit 1 ;; +esac +case "$file" in + pool/*.deb) ;; + *) echo "steam: unexpected file '$file'" >&2; exit 1 ;; +esac + +if [ "${1:-}" = --version ]; then + echo "$version" + exit 0 +fi +DIR="${1:?usage: package.sh --version | }" +[ -f "$DIR/app.toml" ] || { echo "steam: $DIR/app.toml is missing" >&2; exit 1; } + +curl -fsSL -o "$TMP/steam.deb" "$REPO/$file" +echo "$sha $TMP/steam.deb" | sha256sum -c --quiet - || { echo "steam: .deb checksum mismatch" >&2; exit 1; } +mkdir "$TMP/x" +dpkg-deb -x "$TMP/steam.deb" "$TMP/x" + +# The launcher script finds its bootstrap next to itself, and must be called +# "steam" (it uses its own name as the package name). +L="$TMP/x/usr/lib/steam" +install -Dm755 "$L/bin_steam.sh" "$DIR/steam/steam" +install -Dm644 "$L/bootstraplinux_ubuntu12_32.tar.xz" "$DIR/steam/bootstraplinux_ubuntu12_32.tar.xz" +# Controller access (uinput, Steam Controller, DualSense...): the image +# installs these rules (image/build.sh). +for r in "$TMP"/x/lib/udev/rules.d/*.rules; do + install -Dm644 "$r" "$DIR/udev/$(basename "$r")" +done +install -Dm644 "$TMP/x/usr/share/doc/steam-launcher/copyright" "$DIR/steam/COPYRIGHT" +sed -i "s/^version = .*/version = \"$version\"/" "$DIR/app.toml" +echo "$version" diff --git a/valve-archive-keyring.gpg b/valve-archive-keyring.gpg new file mode 100644 index 0000000000000000000000000000000000000000..986e9bf42b7ddaedbf13c0b20247aa855b57da54 GIT binary patch literal 2768 zcmaKuX*d*$8pmhGSjU!qitFDoW{Pi5GiEoQf~Kj&vVc7+~+yp-%tPd{r!J$4p0Dmkzue45_SI5ao;qIZP$ddLncCWrEzLu^nm87 zoQRfZMwv~tr@QxYRC$Yxf4R8xn3h@_IyQUfCNa$>izT{`eL2$UzNJWm*cvYg+N>F< z%l4KdC#czxQ2kLq%Z&1twNJ3nOYryBpQ^#hh>3J?3$-pNd=UF4|77=MEjvO8!FqW! zr~ujNo?q|y>c#7Io*K2J3_O*)eM~U^#jWc;1*58cgUOA;q(100l399e!OA5VaObNkb1A+pt;>md2aqqwY!z3UIEDGcUoCV2pfaHN7$tVdJ zxKT>tb4n<{W6)itXao7NpvED)o)bhYzGBJ=;pO4x;1uWM<$-WYfH;5v03WaLUo(gw zJb);9G?UiNnTAuozau2WZTJ0wTszMd<0y~V2EnOE6rEa~c){ZY4a*0yQYzDm0sd~M zN!k2*eEjKI-J+DP2By_{FyqX!rn8c}0sMF`mOFXusJ4{9T#L=5DZiavFkgHfS9%^HQ_=ohh!6$$qfC4AzVs9B%>M+!bSz>d3F>Ums|*1+%x_>g+`-k3HPe5k<$IX4QzVS-czHAdXX?%gnsM zRId4is1~(tS3O15RNuIFU*VA1WwaP!#$X64_jLz5<25aOoMCb|x@)tZ`qnFxybm^{TGx8U|CwXWI|I7`)WNJ_L4@=O1hCZ^D2h$J;Sn#GYA1ZbY8P!spqED?=M5F@*__jLybn zDL+@at7`k(lX%RJb2<-}vTZ4Q0|>VC^^l$|LEBtHaRut_Z1wGH+8gfQJlxJ6hyuOw zs7B-DOl~$tCKrmWB$T0jkAdwsss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