build: package remus as a Flatpak for SteamOS

SteamOS has a read-only root filesystem, so a Flatpak is the way to
install it. The build is offline from vendored crates. make
flatpak-bundle writes one file to copy to a Steam machine, and
make sdk-check runs the checks inside the SDK for hosts without the
GStreamer development files.
This commit is contained in:
Ansho Rei
2026-11-04 02:19:07 +01:00
parent af307549a8
commit a74fd1bd5c
6 changed files with 139 additions and 1 deletions
+29 -1
View File
@@ -9,9 +9,14 @@ DEMO_PASS ?= demo
SHOTS_DIR := target/shots
SCRATCH := target/scratch
FLATPAK_ID := me.anshorei.Fettleshed.Remus
FLATPAK_DIR := target/flatpak
FLATPAK_SDK := org.freedesktop.Sdk//26.08
FLATPAK_BUILDER := $(shell command -v flatpak-builder 2>/dev/null || echo flatpak run org.flatpak.Builder)
.PHONY: help
help: ## List the targets
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## Debug build
@@ -65,6 +70,29 @@ shots: ## Screenshot the main screens against the demo server into target/shots
REMUS_DEV_SCRIPT="wait:4000,shot:$(SHOTS_DIR)/home.png,right,activate,wait:3000,shot:$(SHOTS_DIR)/album.png,down,activate,wait:3000,now-playing,wait:2500,shot:$(SHOTS_DIR)/now-playing.png,play-pause,back,section-next,section-next,section-next,wait:3000,shot:$(SHOTS_DIR)/artists.png,quit" \
./target/debug/remus
.PHONY: sdk-check
sdk-check: ## make check inside the Flatpak SDK, which has the GStreamer dev files
flatpak run --share=network --filesystem=$(CURDIR) --command=sh $(FLATPAK_SDK) -c '\
export PATH=$$PATH:/usr/lib/sdk/rust-stable/bin CARGO_HOME=$(CURDIR)/target/sdk/cargo-home \
CARGO_TARGET_DIR=$(CURDIR)/target/sdk REMUS_AUDIO_SINK=fakesink && \
cd $(CURDIR) && cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test'
.PHONY: flatpak
flatpak: ## Build the Flatpak into target/flatpak/repo
cargo vendor --locked $(FLATPAK_DIR)/vendor > /dev/null
$(FLATPAK_BUILDER) --user --install-deps-from=flathub --force-clean --state-dir=$(FLATPAK_DIR)/state \
--repo=$(FLATPAK_DIR)/repo $(FLATPAK_DIR)/build flatpak/$(FLATPAK_ID).yml
.PHONY: flatpak-install
flatpak-install: flatpak ## Build the Flatpak and install it for this user
flatpak --user remote-add --if-not-exists --no-gpg-verify remus-local $(FLATPAK_DIR)/repo
flatpak --user install -y --reinstall remus-local $(FLATPAK_ID)
.PHONY: flatpak-bundle
flatpak-bundle: flatpak ## Build target/flatpak/remus.flatpak, a single file to copy to a Steam machine
flatpak build-bundle --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo \
$(FLATPAK_DIR)/repo $(FLATPAK_DIR)/remus.flatpak $(FLATPAK_ID)
.PHONY: clean
clean: ## Remove build output, screenshots and scratch config
cargo clean
+20
View File
@@ -21,6 +21,26 @@ On first start remus asks for the server address, username and password. It stor
Covers are cached in `~/.cache/remus/covers`.
## Install on SteamOS
Build the bundle on any Linux machine with Flatpak:
```
make flatpak-bundle # writes target/flatpak/remus.flatpak
```
`make flatpak` needs `org.flatpak.Builder` from Flathub. It fetches the freedesktop 26.08 SDK and its Rust extension on first use.
On the Steam machine, in Desktop Mode:
1. Copy `remus.flatpak` over and install it from a terminal: `flatpak install --user remus.flatpak`. Flatpak pulls the freedesktop 26.08 runtime from Flathub.
2. In Steam, choose Games → Add a Non-Steam Game to My Library and pick Remus.
3. Back in Game Mode, open its controller settings and pick a Gamepad layout, so Steam passes the buttons through as a controller and not as keyboard and mouse.
The Flatpak keeps its login and cover cache in `~/.var/app/me.anshorei.Fettleshed.Remus/`, not in `~/.config` and `~/.cache`. Flatpak sets `XDG_CONFIG_HOME` itself there, so overriding it with `flatpak run --env` has no effect.
To update, build a new bundle and install it the same way.
## Controls
| Gamepad | Keyboard | Action |
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=Remus
Comment=Play your Subsonic music library with a controller
Exec=remus
Icon=me.anshorei.Fettleshed.Remus
Terminal=false
Categories=AudioVideo;Audio;Player;
Keywords=music;subsonic;navidrome;player;
StartupNotify=true
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>me.anshorei.Fettleshed.Remus</id>
<name>Remus</name>
<summary>Play your Subsonic music library with a controller</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license>
<description>
<p>
A fullscreen music player for a Subsonic or OpenSubsonic server, built for SteamOS.
It is driven entirely with a gamepad and scales to look the same on a Steam Deck
and on a 4K TV.
</p>
</description>
<launchable type="desktop-id">me.anshorei.Fettleshed.Remus.desktop</launchable>
<url type="vcs-browser">https://gitea.anshorei.me/Fettleshed/remus</url>
<supports>
<control>gamepad</control>
<control>keyboard</control>
</supports>
<content_rating type="oars-1.1"/>
<releases>
<release version="0.1.0" date="2026-11-04"/>
</releases>
</component>
+8
View File
@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128">
<rect x="8" y="8" width="112" height="112" rx="26" fill="#14171d"/>
<circle cx="64" cy="64" r="40" fill="#0d0f13"/>
<circle cx="64" cy="64" r="33" fill="none" stroke="#2a2f39" stroke-width="2"/>
<circle cx="64" cy="64" r="25" fill="none" stroke="#2a2f39" stroke-width="2"/>
<circle cx="64" cy="64" r="15" fill="#8ab4ff"/>
<circle cx="64" cy="64" r="4" fill="#0d0f13"/>
</svg>

After

Width:  |  Height:  |  Size: 476 B

+47
View File
@@ -0,0 +1,47 @@
id: me.anshorei.Fettleshed.Remus
runtime: org.freedesktop.Platform
runtime-version: '26.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
command: remus
finish-args:
- --share=network
- --share=ipc
- --socket=wayland
- --socket=fallback-x11
- --socket=pulseaudio
# GPU rendering and gamepads (evdev). --device=input would be narrower but
# needs Flatpak 1.15.6, which not every SteamOS release ships.
- --device=all
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
env:
CARGO_HOME: /run/build/remus/cargo-home
modules:
- name: remus
buildsystem: simple
build-commands:
# Crates come from the vendor directory `make flatpak` prepares: the build has no network.
- mkdir -p .cargo
- printf '[source.crates-io]\nreplace-with = "vendored"\n[source.vendored]\ndirectory = "vendor"\n' > .cargo/config.toml
- cargo build --release --offline --locked
- install -Dm755 target/release/remus /app/bin/remus
- install -Dm644 flatpak/me.anshorei.Fettleshed.Remus.desktop /app/share/applications/me.anshorei.Fettleshed.Remus.desktop
- install -Dm644 flatpak/me.anshorei.Fettleshed.Remus.metainfo.xml /app/share/metainfo/me.anshorei.Fettleshed.Remus.metainfo.xml
- install -Dm644 flatpak/me.anshorei.Fettleshed.Remus.svg /app/share/icons/hicolor/scalable/apps/me.anshorei.Fettleshed.Remus.svg
- install -Dm644 LICENSE /app/share/licenses/me.anshorei.Fettleshed.Remus/LICENSE
sources:
- type: dir
path: ..
skip:
- target
- .git
- .worklane
- .flatpak-builder
- type: dir
path: ../target/flatpak/vendor
dest: vendor