Merge branch 'linux-release'

This commit is contained in:
yuriy.p committed 2026-10-16 12:33:46 +06:00
commit 118fa3cf11
10 files changed
+304 -3

No files matched your search

+4
View File
@@ -1,3 +1,7 @@
/target /target
.DS_Store .DS_Store
/design/shots /design/shots
/packaging/arch/src
/packaging/arch/pkg
/packaging/arch/musyx
/packaging/arch/*.pkg.tar.*
+21
View File
@@ -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.
+25 -2
View File
@@ -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 `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). (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 `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.
## Settings ## Settings
Settings (streaming quality, appearance, language, volume) are kept in Settings (streaming quality, appearance, language, volume) are kept in
`~/Library/Application Support/Musyx/settings.json`. Covers are cached under `~/Library/Application Support/Musyx/settings.json` on macOS and
`~/Library/Caches/Musyx/covers` and can be cleared from Settings. `~/.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` 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 endpoint, decrypting its AES-CTR stream in memory). Yandex decides what to grant by
+10
View File
@@ -18,6 +18,10 @@ use iced::{Size, window};
use app::App; use app::App;
use ui::theme; 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 = "it.panov.musyx.desktop";
fn main() -> iced::Result { fn main() -> iced::Result {
let app = iced::application(App::new, App::update, App::view) let app = iced::application(App::new, App::update, App::view)
.title(App::title) .title(App::title)
@@ -28,6 +32,12 @@ fn main() -> iced::Result {
size: Size::new(1280.0, 800.0), size: Size::new(1280.0, 800.0),
min_size: Some(Size::new(960.0, 620.0)), min_size: Some(Size::new(960.0, 620.0)),
icon: window::icon::from_file_data(include_bytes!("../assets/icon/musyx.png"), None).ok(), icon: window::icon::from_file_data(include_bytes!("../assets/icon/musyx.png"), None).ok(),
// 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(),
..Default::default()
},
..window::Settings::default() ..window::Settings::default()
}) })
.centered(); .centered();
+1
View File
@@ -24,6 +24,7 @@ impl NowPlaying {
}) })
} }
#[cfg(any(target_os = "macos", test))]
fn line(&self) -> String { fn line(&self) -> String {
if self.artist.is_empty() { self.title.clone() } else { format!("{} — {}", self.title, self.artist) } if self.artist.is_empty() { self.title.clone() } else { format!("{} — {}", self.title, self.artist) }
} }
+56
View File
@@ -0,0 +1,56 @@
# Maintainer: Yuriy Panov <uriy.panov@gmail.com>
# 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=it.panov.musyx.desktop
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"
}
@@ -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=it.panov.musyx.desktop
Terminal=false
Categories=AudioVideo;Audio;Player;
Keywords=music;yandex;player;audio;
Keywords[ru]=музыка;яндекс;плеер;аудио;
StartupWMClass=it.panov.musyx.desktop
SingleMainWindow=true
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>it.panov.musyx.desktop</id>
<name>Musyx</name>
<summary>Desktop player for Yandex Music</summary>
<summary xml:lang="ru">Настольный проигрыватель для Яндекс Музыки</summary>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<developer id="it.panov">
<name>Yuriy Panov</name>
</developer>
<description>
<p>
An unofficial client for Yandex Music: My Wave, search, your collection, podcasts,
lyrics and lossless streaming. Not affiliated with or endorsed by Yandex.
</p>
</description>
<launchable type="desktop-id">it.panov.musyx.desktop.desktop</launchable>
<categories>
<category>AudioVideo</category>
<category>Audio</category>
<category>Player</category>
</categories>
<content_rating type="oars-1.1"/>
<releases>
<release version="0.2.0" date="2026-10-16"/>
</releases>
</component>
+143
View File
@@ -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="it.panov.musyx.desktop"
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" <<CONTROL
Package: musyx
Version: $version
Architecture: $deb_arch
Maintainer: Yuriy Panov <uriy.panov@gmail.com>
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
+1 -1
View File
@@ -36,7 +36,7 @@ cat > "$bundle/Contents/Info.plist" <<PLIST
<dict> <dict>
<key>CFBundleName</key><string>Musyx</string> <key>CFBundleName</key><string>Musyx</string>
<key>CFBundleDisplayName</key><string>Musyx</string> <key>CFBundleDisplayName</key><string>Musyx</string>
<key>CFBundleIdentifier</key><string>dev.musyx.desktop</string> <key>CFBundleIdentifier</key><string>it.panov.musyx.desktop</string>
<key>CFBundleDevelopmentRegion</key><string>en</string> <key>CFBundleDevelopmentRegion</key><string>en</string>
<key>CFBundleLocalizations</key><array><string>en</string><string>ru</string></array> <key>CFBundleLocalizations</key><array><string>en</string><string>ru</string></array>
<key>CFBundleExecutable</key><string>Musyx</string> <key>CFBundleExecutable</key><string>Musyx</string>