Files
spotifast/packaging/flatpak/rocks.spotifast.Spotifast.yml
Carmine Paolino eead127f00 Guard the running copy with fastframe-instance
The single-instance guard and remote-control channel now come from
fastframe-instance, which ZapFast shares. The running copy holds a lock
in a private per-user directory, released by the system even after a
crash, and answers on a socket only the user can open (on Linux and
macOS), or on Windows on a loopback port that answers only requests
carrying a random token. It replaces the fixed port 47113, which any
local program could reach, and the D-Bus name on Linux.

The protocol prefix is now spotifast:, so no Fastpotify name is left in
it. Because Linux uses the same channel, every spotifast subcommand
works there too, and MPRIS stays for media keys and desktop players.
Requests keep their argument checks. A copy started from a release
before this one does not find the new guard, so for that one update two
copies can briefly run. The Flatpak no longer asks for the old bus name.
The Nix vendor hash follows the lockfile.
2026-10-03 14:18:35 +02:00

65 lines
3.0 KiB
YAML

# Spotifast as a Flatpak, built from source: the manifest Flathub builds
# from. The copy in the Flathub repository names a tag and its commit in
# the source below and carries cargo-sources.json next to it; flathub.sh
# writes both. For a local build, this one takes the checkout as it is:
#
# flatpak-builder --user --install --force-clean build-dir \
# packaging/flatpak/rocks.spotifast.Spotifast.yml
#
# The release workflow does not build from source twice: it packages the
# binary the Linux job already built, through the bundle manifest beside
# this one, whose finish-args are the same as these.
id: rocks.spotifast.Spotifast
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
command: spotifast
finish-args:
# Wayland first, X11 when that is what there is.
- --socket=wayland
- --socket=fallback-x11
- --share=ipc
- --device=dri
# Sound: PulseAudio, which PipeWire also answers.
- --socket=pulseaudio
# Spotify's API, the streaming session, the sign-in's local redirect, and
# mDNS for receivers on the network.
- --share=network
# The tray item, media keys and Now Playing over MPRIS, and the name the
# single instance is found by.
# Platform storage for this application's Spotify grants.
- --talk-name=org.freedesktop.secrets
- --talk-name=org.kde.StatusNotifierWatcher
- --own-name=org.mpris.MediaPlayer2.spotifast
# Older Flatpak versions leave XDG_STATE_HOME unset. Keep the fallback
# state directory (session, history, logs, and credential markers) durable.
- --persist=.local/state
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
env:
CARGO_HOME: /run/build/spotifast/cargo
modules:
- name: spotifast
buildsystem: simple
build-commands:
- cargo --offline fetch --manifest-path Cargo.toml --verbose
- cargo --offline build --release --locked
- install -Dm755 target/release/spotifast /app/bin/spotifast
- install -Dm644 packaging/applications/*.desktop /app/share/applications/rocks.spotifast.Spotifast.desktop
- sed -i 's/^Icon=.*$/Icon=rocks.spotifast.Spotifast/;s/^StartupWMClass=spotifast$/StartupWMClass=rocks.spotifast.Spotifast/' /app/share/applications/rocks.spotifast.Spotifast.desktop
- install -Dm644 packaging/icons/*.svg /app/share/icons/hicolor/scalable/apps/rocks.spotifast.Spotifast.svg
- install -Dm644 packaging/flatpak/rocks.spotifast.Spotifast.metainfo.xml /app/share/metainfo/rocks.spotifast.Spotifast.metainfo.xml
- install -Dm644 LICENSE /app/share/licenses/spotifast/LICENSE
sources:
- type: dir
path: ../..
# Supply the current app ID even when generating a manifest for an older tag.
- type: file
path: rocks.spotifast.Spotifast.metainfo.xml
dest: packaging/flatpak
# Every crate the lockfile names, for the offline build; flathub.sh
# writes it with flatpak-cargo-generator.
- cargo-sources.json