music-assistant: bring back airplay support
This commit is contained in:
@@ -95,6 +95,10 @@ in
|
||||
[
|
||||
lsof
|
||||
]
|
||||
++ lib.optionals (lib.elem "airplay" cfg.providers) [
|
||||
cliairplay
|
||||
libraop
|
||||
]
|
||||
++ lib.optionals (lib.elem "airplay_receiver" cfg.providers) [
|
||||
shairport-sync
|
||||
]
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
diff --git a/music_assistant/providers/airplay/helpers.py b/music_assistant/providers/airplay/helpers.py
|
||||
index c5fef7eb..a628622d 100644
|
||||
--- a/music_assistant/providers/airplay/helpers.py
|
||||
+++ b/music_assistant/providers/airplay/helpers.py
|
||||
@@ -6,6 +6,7 @@
|
||||
import os
|
||||
import platform
|
||||
import time
|
||||
+from shutil import which
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from zeroconf import IPVersion
|
||||
@@ -176,7 +177,6 @@ async def check_binary(cli_path: str) -> str | None:
|
||||
pass
|
||||
return None
|
||||
|
||||
- base_path = os.path.join(os.path.dirname(__file__), "bin")
|
||||
system = platform.system().lower().replace("darwin", "macos")
|
||||
architecture = platform.machine().lower()
|
||||
|
||||
@@ -188,7 +188,7 @@ async def check_binary(cli_path: str) -> str | None:
|
||||
raise RuntimeError(f"Unsupported streaming protocol requested: {protocol}")
|
||||
|
||||
if bridge_binary := await check_binary(
|
||||
- os.path.join(base_path, f"{package}-{system}-{architecture}")
|
||||
+ which(package)
|
||||
):
|
||||
return bridge_binary
|
||||
|
||||
@@ -40,11 +40,6 @@ let
|
||||
|
||||
pythonPath = python.pkgs.makePythonPath providerDependencies;
|
||||
in
|
||||
|
||||
assert
|
||||
(lib.elem "airplay" providers)
|
||||
-> throw "music-assistant: airplay support is missing libraop, a library we will not package because it depends on OpenSSL 1.1.";
|
||||
|
||||
python.pkgs.buildPythonApplication rec {
|
||||
pname = "music-assistant";
|
||||
version = "2.7.8";
|
||||
@@ -69,6 +64,9 @@ python.pkgs.buildPythonApplication rec {
|
||||
# Look up shairport-sync from PATH at runtime
|
||||
./shairport-sync.patch
|
||||
|
||||
# Look up cliraop/cliap2 from PATH at runtime
|
||||
./cliraop-cliap2.patch
|
||||
|
||||
# Disable interactive dependency resolution, which clashes with the immutable Python environment
|
||||
./dont-install-deps.patch
|
||||
|
||||
@@ -95,6 +93,7 @@ python.pkgs.buildPythonApplication rec {
|
||||
--replace-fail "get-mac" "getmac"
|
||||
|
||||
rm -rv \
|
||||
music_assistant/providers/airplay/bin/{cliap2-*,cliraop-*} \
|
||||
music_assistant/providers/airplay_receiver/bin/{build_binaries.sh,shairport-sync-*} \
|
||||
music_assistant/providers/spotify/bin
|
||||
'';
|
||||
@@ -196,11 +195,6 @@ python.pkgs.buildPythonApplication rec {
|
||||
|
||||
pythonImportsCheck = [ "music_assistant" ];
|
||||
|
||||
postFixup = ''
|
||||
# binary native code, segfaults when autopatchelf'd, requires openssl 1.1 to build
|
||||
rm $out/${python3.sitePackages}/music_assistant/providers/airplay/bin/cliraop-*
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit
|
||||
python
|
||||
|
||||
Reference in New Issue
Block a user