From c9e191434b5918319ddc7cc7641d876d275afebe Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 9 Jul 2023 00:03:59 +0200 Subject: [PATCH] shairport-sync: fix cross compilation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Tools from the glib.dev output need to be in PATH for cross compilation to work. Not sure if there is a cleaner way than my string trick to do it… - The upstream configure script neglects to check for $AR properly, so we need to pass it explicitly. --- pkgs/servers/shairport-sync/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/shairport-sync/default.nix b/pkgs/servers/shairport-sync/default.nix index 2a160ab9ab88..b9b4ff868e0f 100644 --- a/pkgs/servers/shairport-sync/default.nix +++ b/pkgs/servers/shairport-sync/default.nix @@ -49,7 +49,21 @@ stdenv.mkDerivation rec { hash = "sha256-ru2iaXSgS+w2ktqGLGC9SiYztkmmOQVzHaeLwMqvMzk="; }; - nativeBuildInputs = [ autoreconfHook pkg-config ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + # For glib we want the `dev` output for the same library we are + # also linking against, since pkgsHostTarget.glib.dev exposes + # some extra tools that are built for build->host execution. + # To achieve this, we coerce the output to a string to prevent + # mkDerivation's splicing logic from kicking in. + "${glib.dev}" + ]; + + makeFlags = [ + # Workaround for https://github.com/mikebrady/shairport-sync/issues/1705 + "AR=${stdenv.cc.bintools.targetPrefix}ar" + ]; buildInputs = [ openssl @@ -100,6 +114,8 @@ stdenv.mkDerivation rec { ++ optional enableLibdaemon "--with-libdaemon" ++ optional enableAirplay2 "--with-airplay-2"; + strictDeps = true; + meta = with lib; { homepage = "https://github.com/mikebrady/shairport-sync"; description = "Airtunes server and emulator with multi-room capabilities";