Steam as a Fennec OS store app
Some checks failed
release / release (push) Failing after 32s

Split from the Fennec OS repository (apps/steam, tools/pkg/steam). The id
is now support.bluefox.steam. The release workflow follows Valve's
steam-launcher: a new Valve version becomes release v<version>.

The controller udev rules and the 32-bit libraries stay in the OS image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tamas Csikel
2026-10-25 17:35:02 +01:00
parent 4b09b44aa9
commit 460da31b8b
9 changed files with 211 additions and 84 deletions

77
fetch-steam.sh Executable file
View File

@@ -0,0 +1,77 @@
#!/usr/bin/env bash
# Valve's official Steam launcher: 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.
#
# fetch-steam.sh --version prints the newest official version (1.0.0.87)
# fetch-steam.sh <pkg-dir> fills <pkg-dir> (with app.toml in it) and sets
# the version in its app.toml
#
# Used by package.sh, which the release workflow runs.
#
# 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: "version<TAB>filename<TAB>sha256".
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: fetch-steam.sh --version | <pkg-dir>}"
[ -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"
# The controller udev rules in the .deb are installed by Fennec OS itself
# (the image), not by this app.
install -Dm644 "$TMP/x/usr/share/doc/steam-launcher/copyright" "$DIR/steam/COPYRIGHT"
sed -i "s/^version = .*/version = \"$version\"/" "$DIR/app.toml"
echo "$version"