libjack2: fix darwin build
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
{ stdenv, fetchFromGitHub, pkgconfig, python2Packages, makeWrapper
|
||||
, bash, libsamplerate, libsndfile, readline, eigen, celt
|
||||
# Darwin Dependencies
|
||||
, aften, AudioToolbox, CoreAudio, CoreFoundation
|
||||
|
||||
# Optional Dependencies
|
||||
, dbus ? null, libffado ? null, alsaLib ? null
|
||||
, libopus ? null
|
||||
, darwin
|
||||
|
||||
# Extra options
|
||||
, prefix ? ""
|
||||
@@ -16,7 +19,7 @@ let
|
||||
|
||||
libOnly = prefix == "lib";
|
||||
|
||||
optDbus = shouldUsePkg dbus;
|
||||
optDbus = if stdenv.isDarwin then null else shouldUsePkg dbus;
|
||||
optPythonDBus = if libOnly then null else shouldUsePkg dbus-python;
|
||||
optLibffado = if libOnly then null else shouldUsePkg libffado;
|
||||
optAlsaLib = if libOnly then null else shouldUsePkg alsaLib;
|
||||
@@ -34,21 +37,36 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig python makeWrapper ];
|
||||
buildInputs = [ python libsamplerate libsndfile readline eigen celt
|
||||
buildInputs = [ libsamplerate libsndfile readline eigen celt
|
||||
optDbus optPythonDBus optLibffado optAlsaLib optLibopus
|
||||
];
|
||||
] ++ stdenv.lib.optionals stdenv.isDarwin [ aften AudioToolbox CoreAudio CoreFoundation ];
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace svnversion_regenerate.sh --replace /bin/bash ${bash}/bin/bash
|
||||
# CoreFoundation 10.10 doesn't include CFNotificationCenter.h yet.
|
||||
patches = stdenv.lib.optionals stdenv.isDarwin [ ./clang.patch ./darwin-cf.patch ];
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace svnversion_regenerate.sh \
|
||||
--replace /bin/bash ${bash}/bin/bash
|
||||
'';
|
||||
|
||||
# It looks like one of the frameworks depends on <CoreFoundation/CFAttributedString.h>
|
||||
# since frameworks are impure we also have to use the impure CoreFoundation here.
|
||||
# FIXME: remove when CoreFoundation is updated to 10.11
|
||||
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
|
||||
python waf configure --prefix=$out \
|
||||
${optionalString (optDbus != null) "--dbus"} \
|
||||
--classic \
|
||||
${optionalString (optLibffado != null) "--firewire"} \
|
||||
${optionalString (optAlsaLib != null) "--alsa"} \
|
||||
--autostart=${if (optDbus != null) then "dbus" else "classic"} \
|
||||
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
|
||||
Reference in New Issue
Block a user