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:
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
* text=auto eol=lf
|
||||
*.ttf binary
|
||||
*.png binary
|
||||
*.gpg binary
|
||||
75
.gitea/workflows/release.yml
Normal file
75
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,75 @@
|
||||
# Follows Valve's official steam-launcher: when Valve has a version that has
|
||||
# no release here yet, builds the store package and publishes release
|
||||
# v<version> (tag on the current main). Every Monday, on every push to main,
|
||||
# and by hand.
|
||||
#
|
||||
# Runner hygiene (shared host, little disk): runs in the runner image that is
|
||||
# already on the host (no image pull), uses no `uses:` actions (no action
|
||||
# cache), and deletes everything it made at the end.
|
||||
name: release
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "17 4 * * 1"
|
||||
jobs:
|
||||
release:
|
||||
runs-on: build
|
||||
container:
|
||||
image: docker.gitea.com/runner-images:ubuntu-latest
|
||||
env:
|
||||
W: /tmp/fennec-steam
|
||||
CARGO_HOME: /tmp/fennec-steam/cargo
|
||||
RUSTUP_HOME: /tmp/fennec-steam/rustup
|
||||
CARGO_TARGET_DIR: /tmp/fennec-steam/target
|
||||
SDK_GIT: https://gitea.bluefox.support/fennec/sdk
|
||||
SDK_TAG: v0.1.0
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
mkdir -p "$W"
|
||||
git clone --depth 1 --branch main \
|
||||
"${GITHUB_SERVER_URL%%://*}://oauth2:${{ secrets.GITHUB_TOKEN }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git" "$W/src"
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq --no-install-recommends gpgv dpkg >/dev/null
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
- name: New Valve version?
|
||||
id: check
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
v=$(bash "$W/src/fetch-steam.sh" --version)
|
||||
code=$(curl -s -o /dev/null -w '%{http_code}' -H "Authorization: token $TOKEN" \
|
||||
"$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases/tags/v$v")
|
||||
echo "Valve: $v, release v$v: HTTP $code"
|
||||
echo "version=$v" >> "$GITHUB_OUTPUT"
|
||||
[ "$code" = 200 ] && echo "new=0" >> "$GITHUB_OUTPUT" || echo "new=1" >> "$GITHUB_OUTPUT"
|
||||
- name: Build
|
||||
if: steps.check.outputs.new == '1'
|
||||
run: |
|
||||
curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal --no-modify-path
|
||||
export PATH="$CARGO_HOME/bin:$PATH"
|
||||
cargo install -q --locked --git "$SDK_GIT" --tag "$SDK_TAG" sf-pack
|
||||
"$W/src/package.sh"
|
||||
ls "$W"/src/dist | grep -q -- "-${{ steps.check.outputs.version }}.tar.zst$" || { echo "built another version" >&2; exit 1; }
|
||||
- name: Release
|
||||
if: steps.check.outputs.new == '1'
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
V: ${{ steps.check.outputs.version }}
|
||||
run: |
|
||||
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases"
|
||||
id=$(curl -fsS -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"v$V\",\"target_commitish\":\"main\",\"name\":\"v$V\",\"body\":\"Valve steam-launcher $V\"}" "$api" \
|
||||
| grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
for f in "$W"/src/dist/*; do
|
||||
curl -fsS -H "Authorization: token $TOKEN" -F "attachment=@$f" "$api/$id/assets?name=$(basename "$f")" >/dev/null
|
||||
done
|
||||
echo "released v$V"
|
||||
- name: Clean up
|
||||
if: always()
|
||||
run: |
|
||||
rm -rf "$W"
|
||||
df -h / | tail -1
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/pkg
|
||||
/dist
|
||||
20
README.md
Normal file
20
README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Steam for Fennec OS
|
||||
|
||||
A hivatalos Steam kliens Fennec OS store appként, kontrollerrel kezelhető Big Picture felülettel.
|
||||
|
||||
- **Forrás:** Valve hivatalos `steam-launcher` csomagja a `repo.steampowered.com`-ról ([fetch-steam.sh](fetch-steam.sh)).
|
||||
- **Ellenőrzés:** az `InRelease` Valve kulcsával aláírt ([valve-archive-keyring.gpg](valve-archive-keyring.gpg); ugyanaz a kulcs, ami a csomagban van, ujjlenyomat: `BA18 16EF 8E75 005F CF5E 27A1 F24A EA9F B054 98B7`). A `Packages` és a `.deb` SHA256-ja is egyezik.
|
||||
- **Futás:** [bin/smartfox-steam](bin/smartfox-steam). A `gamescope` (Valve kompozitora, mint a Steam Decken) X szervert ad a Steam kliensnek és a játékoknak, és egy Wayland-ablakként mutatja őket. A Steam a kontrolleres felületével indul (`-gamepadui`). A játékok legfeljebb 1080p-ben renderelnek, a gamescope skálázza fel őket a TV felbontására.
|
||||
- **Sandbox:** a Steam a saját konténerében (pressure-vessel) futtatja a játékokat, ez a TV sandboxába ágyazva fut. Engedélyei: `network`, `gpu`, `audio`, `gamepad`, `dbus-session`. Adatai és a játékok: `~/.local/share/smartfox/apps/support.bluefox.steam`.
|
||||
- **Két szint frissül:** a Steam kliens maga is frissíti magát az adatmappájában (ezt a Valve kezeli). Ez az app a launchert (bootstrap) hozza.
|
||||
|
||||
**A Fennec OS adja** (az image-ben), mert rendszerszintű: a `gamescope`, a 32 bites könyvtárak (`steam-libs-i386`, Valve apt-repójából) és a kontrollerek udev-szabályai (a Valve `steam-launcher` csomagjából).
|
||||
|
||||
**Még nincs kipróbálva valódi TV-n:** gamescope beágyazott (nested) módban, Intel N100 Vulkannal, kontrollerrel.
|
||||
|
||||
## Kiadás
|
||||
A verzió mindig a Valve-é (pl. `1.0.0.87`). A [release workflow](.gitea/workflows/release.yml) hetente, minden `main`-pushkor és kézzel is lefut. Ha a Valve-nek van olyan verziója, amihez itt még nincs release, megépíti a csomagot, és kiadja `v<verzió>` néven.
|
||||
|
||||
Ha a wrapper (`bin/`) változik, a következő Valve-verzióval jut ki. Ennek oka, hogy a verzió négy tagja mind a Valve-é.
|
||||
|
||||
Helyben, Linuxon: `./package.sh` (`curl`, `gpgv`, `dpkg-deb` és `sf-pack` kell hozzá). Az eredmény a `dist/` mappába kerül.
|
||||
16
app.toml
16
app.toml
@@ -1,21 +1,25 @@
|
||||
id = "steam"
|
||||
# Fennec OS store app manifest (docs/store-app-guide.md in the Fennec SDK).
|
||||
id = "support.bluefox.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.
|
||||
# Set by fetch-steam.sh to the official steam-launcher version: a release is
|
||||
# made whenever Valve publishes 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."
|
||||
author = "Bluefox"
|
||||
# The wrapper and the packaging; Steam itself is Valve's (steam/COPYRIGHT).
|
||||
license = "MIT"
|
||||
homepage = "https://gitea.bluefox.support/fennec/steam"
|
||||
# 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"
|
||||
icon = "icon.svg"
|
||||
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).
|
||||
# (~/.local/share/smartfox/apps/support.bluefox.steam).
|
||||
permissions = ["network", "gpu", "audio", "gamepad", "dbus-session"]
|
||||
|
||||
0
bin/smartfox-steam
Normal file → Executable file
0
bin/smartfox-steam
Normal file → Executable file
77
fetch-steam.sh
Executable file
77
fetch-steam.sh
Executable 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"
|
||||
10
icon.svg
Normal file
10
icon.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-3 -3 30 30" width="256" height="256">
|
||||
<!-- Steam mark: the piston and valve in a disc (Simple Icons, CC0). -->
|
||||
<defs>
|
||||
<linearGradient id="ice" x1="0.33" y1="0.03" x2="0.67" y2="0.97">
|
||||
<stop offset="0" stop-color="#ffffff"/>
|
||||
<stop offset="1" stop-color="#c7e4f8"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path fill="url(#ice)" d="M11.979 0C5.678 0 .511 4.86.022 11.037l6.432 2.658c.545-.371 1.203-.59 1.912-.59.063 0 .125.004.188.006l2.861-4.142V8.91c0-2.495 2.028-4.524 4.524-4.524 2.494 0 4.524 2.031 4.524 4.527s-2.03 4.525-4.524 4.525h-.105l-4.076 2.911c0 .052.004.105.004.159 0 1.875-1.515 3.396-3.39 3.396-1.635 0-3.016-1.173-3.331-2.727L.436 15.27C1.862 20.307 6.486 24 11.979 24c6.627 0 11.999-5.373 11.999-12S18.605 0 11.979 0zM7.54 18.21l-1.473-.61c.262.543.714.999 1.314 1.25 1.297.539 2.793-.076 3.332-1.375.263-.63.264-1.319.005-1.949s-.75-1.121-1.377-1.383c-.624-.26-1.29-.249-1.878-.03l1.523.63c.956.4 1.409 1.5 1.009 2.455-.397.957-1.497 1.41-2.454 1.012H7.54zm11.415-9.303c0-1.662-1.353-3.015-3.015-3.015-1.665 0-3.015 1.353-3.015 3.015 0 1.665 1.35 3.015 3.015 3.015 1.663 0 3.015-1.35 3.015-3.015zm-5.273-.005c0-1.252 1.013-2.266 2.265-2.266 1.249 0 2.266 1.014 2.266 2.266 0 1.251-1.017 2.265-2.266 2.265-1.253 0-2.265-1.014-2.265-2.265z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
91
package.sh
Normal file → Executable file
91
package.sh
Normal file → Executable file
@@ -1,81 +1,16 @@
|
||||
#!/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 <app-dir> fills <app-dir> (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.
|
||||
# Builds the two store release assets into dist/: app.toml and
|
||||
# support.bluefox.steam-<version>.tar.zst, with Valve's newest launcher
|
||||
# (fetch-steam.sh). Needs curl, gpgv, dpkg-deb and sf-pack (Fennec SDK):
|
||||
# cargo install --locked --git https://gitea.bluefox.support/fennec/sdk --tag v0.1.0 sf-pack
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
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: package.sh --version | <app-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"
|
||||
# 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"
|
||||
rm -rf pkg dist
|
||||
mkdir -p pkg
|
||||
cp -r app.toml icon.svg bin pkg/
|
||||
# Git on Windows loses the x bit.
|
||||
chmod -R a+x pkg/bin
|
||||
bash fetch-steam.sh pkg
|
||||
sf-pack build pkg dist
|
||||
sf-pack verify dist
|
||||
|
||||
Reference in New Issue
Block a user