The packaging/snap/ copy already had the mpris plug but the root snapcraft.yaml was missing it, preventing MPRIS media controls from working in the Snap package.
164 lines
7.0 KiB
YAML
164 lines
7.0 KiB
YAML
# QBZ Snap package configuration
|
|
# NOTE: Keep this file in sync with packaging/snap/snapcraft.yaml.
|
|
|
|
name: qbz-player
|
|
title: "QBZ — Native Qobuz Client for Linux"
|
|
version: '1.1.18'
|
|
summary: Native Qobuz player for Linux with bit-perfect audio and DAC control
|
|
description: |
|
|
QBZ is a native Linux desktop client for Qobuz™, designed for high-fidelity playback.
|
|
|
|
Unlike browser-based players or web wrappers, QBZ uses a native audio pipeline with direct ALSA and PipeWire integration, allowing bit-perfect playback, exclusive device access, and proper per-track sample-rate switching for external DACs.
|
|
|
|
Browsers are limited by system mixers and WebAudio, often resampling audio to 48 kHz. QBZ bypasses these limitations to deliver true high-resolution audio up to 24-bit / 192 kHz on Linux.
|
|
|
|
Features:
|
|
- Native Qobuz™ streaming client (not a web wrapper)
|
|
- Bit-perfect playback with ALSA exclusive mode
|
|
- DAC passthrough and per-track sample-rate switching
|
|
- Hi-Res FLAC playback
|
|
- Queue, playlists, favorites, and offline cache
|
|
- Local library integration
|
|
- Chromecast and DLNA support
|
|
- MPRIS media keys and desktop integration
|
|
- Open source (MIT license)
|
|
|
|
QBZ is built for Linux users and audiophiles who care about how audio actually reaches their hardware.
|
|
|
|
Legal:
|
|
QBZ uses the Qobuz™ API but is not affiliated with, endorsed by, or certified by Qobuz.
|
|
|
|
license: MIT
|
|
contact: https://github.com/vicrodh/qbz/discussions
|
|
website: https://qbz.lol
|
|
source-code: https://github.com/vicrodh/qbz
|
|
issues: https://github.com/vicrodh/qbz/issues
|
|
|
|
grade: stable
|
|
confinement: strict
|
|
base: core22
|
|
icon: packaging/snap/snap/gui/qbz.png
|
|
passthrough:
|
|
layout:
|
|
/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1:
|
|
bind: $SNAP/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1
|
|
/usr/share/alsa:
|
|
bind: $SNAP/usr/share/alsa
|
|
/etc/alsa:
|
|
bind: $SNAP/etc/alsa
|
|
/usr/lib/x86_64-linux-gnu/alsa-lib:
|
|
bind: $SNAP/usr/lib/x86_64-linux-gnu/alsa-lib
|
|
|
|
architectures:
|
|
- build-on: [amd64]
|
|
build-for: [amd64]
|
|
- build-on: [arm64]
|
|
build-for: [arm64]
|
|
|
|
apps:
|
|
qbz:
|
|
command: bin/qbz
|
|
desktop: packaging/snap/snap/gui/qbz.desktop
|
|
extensions: [gnome]
|
|
environment:
|
|
# Prefer GNOME platform GL libs to avoid Mesa/driver mismatches on NVIDIA.
|
|
LD_LIBRARY_PATH: $SNAP/gnome-platform/usr/lib/x86_64-linux-gnu:$SNAP/gnome-platform/lib/x86_64-linux-gnu:$SNAP/gnome-platform/usr/lib/aarch64-linux-gnu:$SNAP/gnome-platform/lib/aarch64-linux-gnu:$SNAP/gnome-platform/usr/lib:$SNAP/gnome-platform/lib:$LD_LIBRARY_PATH
|
|
WEBKIT_EXEC_PATH: $SNAP/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1
|
|
GTK_USE_PORTAL: "0"
|
|
GIO_USE_PORTAL: "0"
|
|
PIPEWIRE_RUNTIME_DIR: $XDG_RUNTIME_DIR/..
|
|
plugs:
|
|
- network
|
|
- network-status
|
|
- audio-playback
|
|
- home
|
|
- removable-media
|
|
- desktop
|
|
- desktop-legacy
|
|
- wayland
|
|
- x11
|
|
- unity7
|
|
- gsettings
|
|
- pulseaudio
|
|
- alsa
|
|
- pipewire
|
|
- mpris
|
|
|
|
parts:
|
|
qbz:
|
|
plugin: rust
|
|
source: https://github.com/vicrodh/qbz.git
|
|
source-tag: v1.1.18
|
|
build-packages:
|
|
- libwebkit2gtk-4.1-dev
|
|
- libgtk-3-dev
|
|
- libayatana-appindicator3-dev
|
|
- librsvg2-dev
|
|
- patchelf
|
|
- libssl-dev
|
|
- libasound2-dev
|
|
- pkg-config
|
|
- curl
|
|
# alsa-utils for aplay command (device enumeration)
|
|
- alsa-utils
|
|
stage-packages:
|
|
- libwebkit2gtk-4.1-0
|
|
- libgtk-3-0
|
|
- libayatana-appindicator3-1
|
|
- libasound2
|
|
- libasound2-data
|
|
- libasound2-plugins
|
|
- libssl3
|
|
- pipewire-bin
|
|
- pulseaudio-utils
|
|
# Include alsa-utils in the snap for aplay -L command
|
|
- alsa-utils
|
|
override-build: |
|
|
export CARGO_HOME="$SNAPCRAFT_PART_BUILD/.cargo"
|
|
export RUSTUP_HOME="$SNAPCRAFT_PART_BUILD/.rustup"
|
|
export PATH="$CARGO_HOME/bin:/usr/bin:/bin:/usr/sbin:/sbin"
|
|
export PKG_CONFIG_PATH="/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig:/usr/share/pkgconfig:/snap/gnome-42-2204-sdk/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig:/snap/gnome-42-2204-sdk/current/usr/share/pkgconfig"
|
|
export LIBRARY_PATH="/usr/lib/$SNAPCRAFT_ARCH_TRIPLET:/snap/gnome-42-2204-sdk/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET"
|
|
export LD_LIBRARY_PATH="/usr/lib/$SNAPCRAFT_ARCH_TRIPLET:/snap/gnome-42-2204-sdk/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET"
|
|
# Core22 ships SQLite 3.37 which lacks sqlite3_error_offset (added 3.38).
|
|
# libsqlite3-dev is pulled in transitively by webkit2gtk-dev, and the
|
|
# RUSTFLAGS -L puts /usr/lib before the bundled sqlite output dir,
|
|
# so the linker finds the old system libsqlite3.a first.
|
|
# Fix: replace system sqlite with a version >= 3.38.
|
|
SQLITE_VER=3460100
|
|
curl -sSf "https://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_VER}.tar.gz" | tar xz
|
|
pushd "sqlite-autoconf-${SQLITE_VER}"
|
|
./configure --quiet --prefix=/usr --libdir="/usr/lib/$SNAPCRAFT_ARCH_TRIPLET"
|
|
make -j"$(nproc)" && make install
|
|
popd
|
|
|
|
export RUSTFLAGS="-L native=/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -L native=/snap/gnome-42-2204-sdk/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -L native=/snap/gnome-42-2204-sdk/current/usr/lib -C link-arg=-Wl,-rpath-link,/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -C link-arg=-Wl,-rpath-link,/snap/gnome-42-2204-sdk/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -C link-arg=-Wl,-rpath-link,/snap/gnome-42-2204-sdk/current/usr/lib"
|
|
export LDFLAGS="-L/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -L/snap/gnome-42-2204-sdk/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -L/snap/gnome-42-2204-sdk/current/usr/lib -Wl,-rpath-link,/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -Wl,-rpath-link,/snap/gnome-42-2204-sdk/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET -Wl,-rpath-link,/snap/gnome-42-2204-sdk/current/usr/lib"
|
|
|
|
if ! command -v cargo >/dev/null 2>&1; then
|
|
curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
|
|
fi
|
|
|
|
# Allow sandboxed builds to override GTK_USE_PORTAL.
|
|
perl -0pi -e 'if ($_ !~ /var_os\\(\"GTK_USE_PORTAL\"\\)/) { s/std::env::set_var\\(\"GTK_USE_PORTAL\", \"1\"\\);/if std::env::var_os\\(\"GTK_USE_PORTAL\"\\).is_none() {\\n std::env::set_var(\"GTK_USE_PORTAL\", \"1\");\\n }/ }' src-tauri/src/main.rs
|
|
|
|
# Install Node.js for frontend build
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
|
apt-get install -y nodejs
|
|
|
|
# Build frontend
|
|
npm ci
|
|
npm run tauri build -- --no-bundle
|
|
|
|
# Install binary, desktop file, and icon
|
|
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
|
|
cp src-tauri/target/release/qbz $SNAPCRAFT_PART_INSTALL/bin/qbz
|
|
mkdir -p $SNAPCRAFT_PART_INSTALL/packaging/snap/snap/gui
|
|
cp packaging/snap/snap/gui/qbz.desktop $SNAPCRAFT_PART_INSTALL/packaging/snap/snap/gui/
|
|
cp packaging/snap/snap/gui/qbz.png $SNAPCRAFT_PART_INSTALL/packaging/snap/snap/gui/
|
|
override-prime: |
|
|
snapcraftctl prime
|
|
if [ -d "$SNAPCRAFT_PRIME/usr/lib/aarch64-linux-gnu" ] && [ ! -e "$SNAPCRAFT_PRIME/usr/lib/x86_64-linux-gnu" ]; then
|
|
ln -s aarch64-linux-gnu "$SNAPCRAFT_PRIME/usr/lib/x86_64-linux-gnu"
|
|
fi
|