Unverified Commit 7684cfcf authored by Sandro Jäckel's avatar Sandro Jäckel
Browse files

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

parent 7797b66e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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; [
+20 −0
Original line number Diff line number Diff line
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"):