music-assistant: replace pre-compiled shairport-sync binaries

This commit is contained in:
Sandro Jäckel
2026-03-01 00:37:06 +01:00
parent 7797b66e3a
commit 7684cfcfee
3 changed files with 37 additions and 1 deletions
@@ -68,6 +68,14 @@ in
};
config = mkIf cfg.enable {
services.avahi = lib.mkIf (lib.elem "airplay_receiver" cfg.providers) {
enable = true;
publish = {
enable = true;
userServices = true;
};
};
systemd.services.music-assistant = {
description = "Music Assistant";
documentation = [ "https://music-assistant.io" ];
@@ -87,6 +95,9 @@ in
[
lsof
]
++ lib.optionals (lib.elem "airplay_receiver" cfg.providers) [
shairport-sync
]
++ lib.optionals (lib.elem "spotify" cfg.providers) [
librespot-ma
]
+6 -1
View File
@@ -66,6 +66,9 @@ python.pkgs.buildPythonApplication rec {
# Look up librespot from PATH at runtime
./librespot.patch
# Look up shairport-sync from PATH at runtime
./shairport-sync.patch
# Disable interactive dependency resolution, which clashes with the immutable Python environment
./dont-install-deps.patch
@@ -91,7 +94,9 @@ python.pkgs.buildPythonApplication rec {
substituteInPlace pyproject.toml \
--replace-fail "get-mac" "getmac"
rm -rv music_assistant/providers/spotify/bin
rm -rv \
music_assistant/providers/airplay_receiver/bin/{build_binaries.sh,shairport-sync-*} \
music_assistant/providers/spotify/bin
'';
build-system = with python.pkgs; [
@@ -0,0 +1,20 @@
diff --git a/music_assistant/providers/airplay_receiver/helpers.py b/music_assistant/providers/airplay_receiver/helpers.py
index 6f2b35df..dd839b73 100644
--- a/music_assistant/providers/airplay_receiver/helpers.py
+++ b/music_assistant/providers/airplay_receiver/helpers.py
@@ -22,15 +22,9 @@ async def check_shairport_sync(shairport_path: str) -> str | None:
except OSError:
return None
- # First, check if bundled binary exists
- base_path = os.path.join(os.path.dirname(__file__), "bin")
system = platform.system().lower().replace("darwin", "macos")
architecture = platform.machine().lower()
- if shairport_binary := await check_shairport_sync(
- os.path.join(base_path, f"shairport-sync-{system}-{architecture}")
- ):
- return shairport_binary
# If no bundled binary, check system PATH
if system_binary := shutil.which("shairport-sync"):