From f80de805c29b101265b9ba557338b8d7946467b3 Mon Sep 17 00:00:00 2001 From: Yuriy Panov Date: Fri, 16 Oct 2026 12:27:50 +0600 Subject: [PATCH 1/3] feat: Linux release packaging Tarball, .deb and AppImage from tool/bundle-linux.sh, and an Arch PKGBUILD. The window carries the dev.musyx.Musyx app id so desktops match it to the installed desktop entry and icons. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 4 + LICENSE | 21 +++ README.md | 27 +++- crates/musyx/src/main.rs | 10 ++ crates/musyx/src/menubar.rs | 1 + packaging/arch/PKGBUILD | 56 ++++++++ packaging/linux/dev.musyx.Musyx.desktop | 15 ++ packaging/linux/dev.musyx.Musyx.metainfo.xml | 28 ++++ tool/bundle-linux.sh | 143 +++++++++++++++++++ 9 files changed, 303 insertions(+), 2 deletions(-) create mode 100644 LICENSE create mode 100644 packaging/arch/PKGBUILD create mode 100644 packaging/linux/dev.musyx.Musyx.desktop create mode 100644 packaging/linux/dev.musyx.Musyx.metainfo.xml create mode 100755 tool/bundle-linux.sh diff --git a/.gitignore b/.gitignore index f78ad2b..0975205 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ /target .DS_Store /design/shots +/packaging/arch/src +/packaging/arch/pkg +/packaging/arch/musyx +/packaging/arch/*.pkg.tar.* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6bef991 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Yuriy Panov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 3f13b72..8563ebe 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,34 @@ This builds a release `Musyx.app` into `target/release/bundle/`, signed with the `MUSYX_SIGN_IDENTITY` to sign with another identity, or to `-` for an ad-hoc signature (each ad-hoc build is a new code identity, so macOS asks again for keychain access). +## Install on Linux + +```sh +tool/bundle-linux.sh # tarball, .deb and AppImage into target/release/bundle/ +tool/bundle-linux.sh tar deb # only the formats named +tool/bundle-linux.sh --install # install into ~/.local (PREFIX picks another prefix) +``` + +On Arch, `makepkg -si` in `packaging/arch` builds and installs the committed `HEAD`. + +Building needs `pkg-config` and the ALSA and D-Bus development files (`alsa-lib` and `dbus` +on Arch, `libasound2-dev` and `libdbus-1-dev` on Debian/Ubuntu). The AppImage also needs +[`appimagetool`](https://github.com/AppImage/appimagetool/releases) on `PATH` (or +`APPIMAGETOOL`). A binary runs only on a glibc at least as new as the one it was built +against, so build release packages on the oldest distro you want to support. + +The desktop entry, metainfo and icons are installed as `dev.musyx.Musyx`, which is also the +window's Wayland app id. The token goes to the Secret Service (GNOME Keyring, KWallet, +KeePassXC), and media keys and the desktop's player widget work through MPRIS. The menu bar +mini player is macOS-only. + ## Settings Settings (streaming quality, appearance, language, volume) are kept in -`~/Library/Application Support/Musyx/settings.json`. Covers are cached under -`~/Library/Caches/Musyx/covers` and can be cleared from Settings. +`~/Library/Application Support/Musyx/settings.json` on macOS and +`~/.config/musyx/settings.json` on Linux. Covers are cached under +`~/Library/Caches/Musyx/covers` (`~/.cache/musyx/covers` on Linux) and can be cleared from +Settings. Streaming quality **Lossless** asks Yandex for FLAC (through the signed `/get-file-info` endpoint, decrypting its AES-CTR stream in memory). Yandex decides what to grant by diff --git a/crates/musyx/src/main.rs b/crates/musyx/src/main.rs index f1304f1..c05f68b 100644 --- a/crates/musyx/src/main.rs +++ b/crates/musyx/src/main.rs @@ -18,6 +18,10 @@ use iced::{Size, window}; use app::App; use ui::theme; +/// The Linux application id: the window's Wayland app id / X11 class and the `.desktop` name. +#[cfg(target_os = "linux")] +const APP_ID: &str = "dev.musyx.Musyx"; + fn main() -> iced::Result { let app = iced::application(App::new, App::update, App::view) .title(App::title) @@ -28,6 +32,12 @@ fn main() -> iced::Result { size: Size::new(1280.0, 800.0), min_size: Some(Size::new(960.0, 620.0)), icon: window::icon::from_file_data(include_bytes!("../assets/icon/musyx.png"), None).ok(), + // Matches the installed `dev.musyx.Musyx.desktop`, so the shell shows its name and icon. + #[cfg(target_os = "linux")] + platform_specific: window::settings::PlatformSpecific { + application_id: APP_ID.to_owned(), + ..Default::default() + }, ..window::Settings::default() }) .centered(); diff --git a/crates/musyx/src/menubar.rs b/crates/musyx/src/menubar.rs index 9493b03..23fc1b7 100644 --- a/crates/musyx/src/menubar.rs +++ b/crates/musyx/src/menubar.rs @@ -24,6 +24,7 @@ impl NowPlaying { }) } + #[cfg(any(target_os = "macos", test))] fn line(&self) -> String { if self.artist.is_empty() { self.title.clone() } else { format!("{} — {}", self.title, self.artist) } } diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD new file mode 100644 index 0000000..486e497 --- /dev/null +++ b/packaging/arch/PKGBUILD @@ -0,0 +1,56 @@ +# Maintainer: Yuriy Panov +# Builds the checked-out commit of this repository: run `makepkg -si` in this directory. +pkgname=musyx +pkgver=0.2.0 +pkgrel=1 +pkgdesc='Desktop player for Yandex Music (unofficial)' +arch=('x86_64' 'aarch64') +license=('MIT' 'OFL-1.1' 'ISC') +depends=('alsa-lib' 'dbus' 'gcc-libs' 'glibc' 'libxkbcommon' 'wayland' 'hicolor-icon-theme') +optdepends=('gnome-keyring: keeps the sign-in (any Secret Service provider works)' + 'vulkan-driver: GPU rendering') +makedepends=('cargo' 'git' 'imagemagick') +options=('!lto' '!debug') +source=("$pkgname::git+file://${startdir%/packaging/arch}") +sha256sums=('SKIP') + +app_id=dev.musyx.Musyx + +pkgver() { + cd "$pkgname" + sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1 +} + +prepare() { + cd "$pkgname" + export RUSTUP_TOOLCHAIN=stable + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" +} + +build() { + cd "$pkgname" + export RUSTUP_TOOLCHAIN=stable CARGO_TARGET_DIR=target + cargo build --frozen --release -p musyx +} + +check() { + cd "$pkgname" + export RUSTUP_TOOLCHAIN=stable CARGO_TARGET_DIR=target + cargo test --frozen --release --workspace +} + +package() { + cd "$pkgname" + install -Dm755 target/release/musyx "$pkgdir/usr/bin/musyx" + install -Dm644 "packaging/linux/$app_id.desktop" "$pkgdir/usr/share/applications/$app_id.desktop" + install -Dm644 "packaging/linux/$app_id.metainfo.xml" "$pkgdir/usr/share/metainfo/$app_id.metainfo.xml" + for size in 16 32 48 64 128 256 512; do + install -dm755 "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps" + magick crates/musyx/assets/icon/musyx.png -resize "${size}x${size}" \ + "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/$app_id.png" + done + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + install -Dm644 crates/musyx/assets/fonts/OFL-*.txt -t "$pkgdir/usr/share/licenses/$pkgname" + install -Dm644 crates/musyx/assets/icons/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE-lucide.txt" + install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md" +} diff --git a/packaging/linux/dev.musyx.Musyx.desktop b/packaging/linux/dev.musyx.Musyx.desktop new file mode 100644 index 0000000..3a34f48 --- /dev/null +++ b/packaging/linux/dev.musyx.Musyx.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Type=Application +Name=Musyx +GenericName=Music Player +GenericName[ru]=Музыкальный проигрыватель +Comment=Desktop player for Yandex Music +Comment[ru]=Настольный проигрыватель для Яндекс Музыки +Exec=musyx +Icon=dev.musyx.Musyx +Terminal=false +Categories=AudioVideo;Audio;Player; +Keywords=music;yandex;player;audio; +Keywords[ru]=музыка;яндекс;плеер;аудио; +StartupWMClass=dev.musyx.Musyx +SingleMainWindow=true diff --git a/packaging/linux/dev.musyx.Musyx.metainfo.xml b/packaging/linux/dev.musyx.Musyx.metainfo.xml new file mode 100644 index 0000000..a0fe39b --- /dev/null +++ b/packaging/linux/dev.musyx.Musyx.metainfo.xml @@ -0,0 +1,28 @@ + + + dev.musyx.Musyx + Musyx + Desktop player for Yandex Music + Настольный проигрыватель для Яндекс Музыки + MIT + MIT + + Yuriy Panov + + +

+ An unofficial client for Yandex Music: My Wave, search, your collection, podcasts, + lyrics and lossless streaming. Not affiliated with or endorsed by Yandex. +

+
+ dev.musyx.Musyx.desktop + + AudioVideo + Audio + Player + + + + + +
diff --git a/tool/bundle-linux.sh b/tool/bundle-linux.sh new file mode 100755 index 0000000..e611536 --- /dev/null +++ b/tool/bundle-linux.sh @@ -0,0 +1,143 @@ +#!/usr/bin/env bash +# Builds Linux release packages into target/release/bundle/. +# tool/bundle-linux.sh # tarball, .deb and AppImage +# tool/bundle-linux.sh tar deb # only the formats named (tar, deb, appimage) +# tool/bundle-linux.sh --install # build, then install into ~/.local +# The Arch package lives in packaging/arch (makepkg there). +# The AppImage needs appimagetool on PATH, or APPIMAGETOOL pointing at it. +# Binaries need the glibc they were built against or newer, so build releases on the +# oldest distro you want to support (Ubuntu 22.04 covers most desktops). +set -euo pipefail + +root="$(cd "$(dirname "$0")/.." && pwd)" +cd "$root" + +formats=() +install=0 +for arg in "$@"; do + case "$arg" in + tar | deb | appimage) formats+=("$arg") ;; + --install) install=1 ;; + *) echo "unknown argument: $arg" >&2; exit 2 ;; + esac +done +if [[ ${#formats[@]} -eq 0 && $install -eq 0 ]]; then + formats=(tar deb appimage) +fi + +app_id="dev.musyx.Musyx" +version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)" +arch="$(uname -m)" +case "$arch" in + x86_64) deb_arch=amd64 ;; + aarch64) deb_arch=arm64 ;; + *) deb_arch="$arch" ;; +esac +out="target/release/bundle" +work="$(mktemp -d)" +trap 'rm -rf "$work"' EXIT + +cargo build --release -p musyx + +# The installed layout, rooted at $1 (a prefix such as /usr): binary, desktop entry, +# AppStream metadata, hicolor icons and licences. +stage() { + local dest="$1" + install -Dm755 target/release/musyx "$dest/bin/musyx" + install -Dm644 "packaging/linux/$app_id.desktop" "$dest/share/applications/$app_id.desktop" + install -Dm644 "packaging/linux/$app_id.metainfo.xml" "$dest/share/metainfo/$app_id.metainfo.xml" + for size in 16 32 48 64 128 256 512; do + mkdir -p "$dest/share/icons/hicolor/${size}x${size}/apps" + magick crates/musyx/assets/icon/musyx.png -resize "${size}x${size}" \ + "$dest/share/icons/hicolor/${size}x${size}/apps/$app_id.png" + done + local doc="$dest/share/doc/musyx" + install -Dm644 LICENSE "$doc/LICENSE" + install -Dm644 README.md "$doc/README.md" + install -Dm644 crates/musyx/assets/fonts/OFL-*.txt -t "$doc" + install -Dm644 crates/musyx/assets/icons/LICENSE.txt "$doc/LICENSE-lucide.txt" +} + +mkdir -p "$out" + +if [[ $install -eq 1 ]]; then + prefix="${PREFIX:-$HOME/.local}" + stage "$prefix" + update-desktop-database "$prefix/share/applications" 2>/dev/null || true + gtk-update-icon-cache -q -t "$prefix/share/icons/hicolor" 2>/dev/null || true + echo "Installed musyx $version into $prefix" +fi + +for format in "${formats[@]}"; do + case "$format" in + tar) + # Unpack anywhere and run ./install.sh (to ~/.local, or PREFIX=/usr/local with sudo). + name="musyx-$version-linux-$arch" + dir="$work/$name" + stage "$dir/files" + cat > "$dir/install.sh" <<'SH' +#!/bin/sh +# Installs Musyx into $PREFIX (default ~/.local). Run with PREFIX=/usr/local as root for all users. +set -eu +prefix="${PREFIX:-$HOME/.local}" +here="$(cd "$(dirname "$0")" && pwd)" +mkdir -p "$prefix" +cp -R "$here/files/." "$prefix/" +update-desktop-database "$prefix/share/applications" 2>/dev/null || true +gtk-update-icon-cache -q -t "$prefix/share/icons/hicolor" 2>/dev/null || true +echo "Installed Musyx into $prefix" +SH + chmod 755 "$dir/install.sh" + tar -C "$work" -czf "$out/$name.tar.gz" "$name" + echo "Built $out/$name.tar.gz" + ;; + + deb) + # Assembled by hand (ar + tar), so dpkg-deb isn't needed on the build machine. + pkg="$work/deb" + stage "$pkg/usr" + installed_kb="$(du -sk "$pkg/usr" | cut -f1)" + mkdir -p "$pkg/DEBIAN" + cat > "$pkg/DEBIAN/control" < +Installed-Size: $installed_kb +Depends: libc6, libgcc-s1, libasound2t64 | libasound2, libdbus-1-3, libxkbcommon0, libwayland-client0 | libx11-6 +Recommends: gnome-keyring | kwalletmanager, libvulkan1 | libgl1 +Section: sound +Priority: optional +Description: Desktop player for Yandex Music + An unofficial client for Yandex Music: My Wave, search, your collection, + podcasts, lyrics and lossless streaming. Not affiliated with Yandex. +CONTROL + (cd "$pkg" && find usr -type f -exec md5sum {} + > DEBIAN/md5sums) + echo "2.0" > "$work/debian-binary" + tar -C "$pkg/DEBIAN" --owner=0 --group=0 -cJf "$work/control.tar.xz" . + tar -C "$pkg" --owner=0 --group=0 --exclude=./DEBIAN -cJf "$work/data.tar.xz" . + deb="$out/musyx_${version}_${deb_arch}.deb" + rm -f "$deb" + (cd "$work" && ar rc "$root/$deb" debian-binary control.tar.xz data.tar.xz) + echo "Built $deb" + ;; + + appimage) + tool="${APPIMAGETOOL:-$(command -v appimagetool || true)}" + if [[ -z "$tool" ]]; then + echo "appimagetool not found: put it on PATH or set APPIMAGETOOL" >&2 + echo " (https://github.com/AppImage/appimagetool/releases)" >&2 + exit 1 + fi + appdir="$work/Musyx.AppDir" + stage "$appdir/usr" + ln -s usr/bin/musyx "$appdir/AppRun" + cp "packaging/linux/$app_id.desktop" "$appdir/$app_id.desktop" + cp "$appdir/usr/share/icons/hicolor/256x256/apps/$app_id.png" "$appdir/$app_id.png" + ln -s "$app_id.png" "$appdir/.DirIcon" + image="$out/Musyx-$version-$arch.AppImage" + ARCH="$arch" "$tool" --no-appstream "$appdir" "$image" >/dev/null + echo "Built $image" + ;; + esac +done From 093c41435a3dc5cbdb068f448da81c855bdaea3f Mon Sep 17 00:00:00 2001 From: Yuriy Panov Date: Fri, 16 Oct 2026 12:33:02 +0600 Subject: [PATCH 2/3] chore: Linux app id it.panov.musyx.desktop Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- crates/musyx/src/main.rs | 4 ++-- packaging/arch/PKGBUILD | 2 +- ...v.musyx.Musyx.desktop => it.panov.musyx.desktop.desktop} | 4 ++-- ...syx.metainfo.xml => it.panov.musyx.desktop.metainfo.xml} | 6 +++--- tool/bundle-linux.sh | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename packaging/linux/{dev.musyx.Musyx.desktop => it.panov.musyx.desktop.desktop} (87%) rename packaging/linux/{dev.musyx.Musyx.metainfo.xml => it.panov.musyx.desktop.metainfo.xml} (86%) diff --git a/README.md b/README.md index 8563ebe..5728a27 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ on Arch, `libasound2-dev` and `libdbus-1-dev` on Debian/Ubuntu). The AppImage al `APPIMAGETOOL`). A binary runs only on a glibc at least as new as the one it was built against, so build release packages on the oldest distro you want to support. -The desktop entry, metainfo and icons are installed as `dev.musyx.Musyx`, which is also the +The desktop entry, metainfo and icons are installed as `it.panov.musyx.desktop`, which is also the window's Wayland app id. The token goes to the Secret Service (GNOME Keyring, KWallet, KeePassXC), and media keys and the desktop's player widget work through MPRIS. The menu bar mini player is macOS-only. diff --git a/crates/musyx/src/main.rs b/crates/musyx/src/main.rs index c05f68b..a7c8628 100644 --- a/crates/musyx/src/main.rs +++ b/crates/musyx/src/main.rs @@ -20,7 +20,7 @@ use ui::theme; /// The Linux application id: the window's Wayland app id / X11 class and the `.desktop` name. #[cfg(target_os = "linux")] -const APP_ID: &str = "dev.musyx.Musyx"; +const APP_ID: &str = "it.panov.musyx.desktop"; fn main() -> iced::Result { let app = iced::application(App::new, App::update, App::view) @@ -32,7 +32,7 @@ fn main() -> iced::Result { size: Size::new(1280.0, 800.0), min_size: Some(Size::new(960.0, 620.0)), icon: window::icon::from_file_data(include_bytes!("../assets/icon/musyx.png"), None).ok(), - // Matches the installed `dev.musyx.Musyx.desktop`, so the shell shows its name and icon. + // Matches the installed `it.panov.musyx.desktop.desktop`, so the shell shows its name and icon. #[cfg(target_os = "linux")] platform_specific: window::settings::PlatformSpecific { application_id: APP_ID.to_owned(), diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index 486e497..2025689 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -14,7 +14,7 @@ options=('!lto' '!debug') source=("$pkgname::git+file://${startdir%/packaging/arch}") sha256sums=('SKIP') -app_id=dev.musyx.Musyx +app_id=it.panov.musyx.desktop pkgver() { cd "$pkgname" diff --git a/packaging/linux/dev.musyx.Musyx.desktop b/packaging/linux/it.panov.musyx.desktop.desktop similarity index 87% rename from packaging/linux/dev.musyx.Musyx.desktop rename to packaging/linux/it.panov.musyx.desktop.desktop index 3a34f48..b5880c6 100644 --- a/packaging/linux/dev.musyx.Musyx.desktop +++ b/packaging/linux/it.panov.musyx.desktop.desktop @@ -6,10 +6,10 @@ GenericName[ru]=Музыкальный проигрыватель Comment=Desktop player for Yandex Music Comment[ru]=Настольный проигрыватель для Яндекс Музыки Exec=musyx -Icon=dev.musyx.Musyx +Icon=it.panov.musyx.desktop Terminal=false Categories=AudioVideo;Audio;Player; Keywords=music;yandex;player;audio; Keywords[ru]=музыка;яндекс;плеер;аудио; -StartupWMClass=dev.musyx.Musyx +StartupWMClass=it.panov.musyx.desktop SingleMainWindow=true diff --git a/packaging/linux/dev.musyx.Musyx.metainfo.xml b/packaging/linux/it.panov.musyx.desktop.metainfo.xml similarity index 86% rename from packaging/linux/dev.musyx.Musyx.metainfo.xml rename to packaging/linux/it.panov.musyx.desktop.metainfo.xml index a0fe39b..8bb3ba7 100644 --- a/packaging/linux/dev.musyx.Musyx.metainfo.xml +++ b/packaging/linux/it.panov.musyx.desktop.metainfo.xml @@ -1,12 +1,12 @@ - dev.musyx.Musyx + it.panov.musyx.desktop Musyx Desktop player for Yandex Music Настольный проигрыватель для Яндекс Музыки MIT MIT - + Yuriy Panov @@ -15,7 +15,7 @@ lyrics and lossless streaming. Not affiliated with or endorsed by Yandex.

- dev.musyx.Musyx.desktop + it.panov.musyx.desktop.desktop AudioVideo Audio diff --git a/tool/bundle-linux.sh b/tool/bundle-linux.sh index e611536..21d5158 100755 --- a/tool/bundle-linux.sh +++ b/tool/bundle-linux.sh @@ -25,7 +25,7 @@ if [[ ${#formats[@]} -eq 0 && $install -eq 0 ]]; then formats=(tar deb appimage) fi -app_id="dev.musyx.Musyx" +app_id="it.panov.musyx.desktop" version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)" arch="$(uname -m)" case "$arch" in From ec64cf7f4bca66a5e7ed7ac0769d1b1eb9d7cb3d Mon Sep 17 00:00:00 2001 From: Yuriy Panov Date: Fri, 16 Oct 2026 12:33:31 +0600 Subject: [PATCH 3/3] chore: macOS bundle id it.panov.musyx.desktop Co-Authored-By: Claude Opus 5.5 --- tool/bundle-macos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/bundle-macos.sh b/tool/bundle-macos.sh index 839a1f1..598d5c7 100755 --- a/tool/bundle-macos.sh +++ b/tool/bundle-macos.sh @@ -36,7 +36,7 @@ cat > "$bundle/Contents/Info.plist" < CFBundleNameMusyx CFBundleDisplayNameMusyx - CFBundleIdentifierdev.musyx.desktop + CFBundleIdentifierit.panov.musyx.desktop CFBundleDevelopmentRegionen CFBundleLocalizationsenru CFBundleExecutableMusyx