@@ -1,5 +1,6 @@
11{ stdenv, fetchFromGitHub, pkgconfig, python2Packages, makeWrapper
22, bash, libsamplerate, libsndfile, readline, eigen, celt
3+, wafHook
34# Darwin Dependencies
45, aften, AudioToolbox, CoreAudio, CoreFoundation
56
@@ -35,13 +36,13 @@ stdenv.mkDerivation rec {
3536 sha256 = "0ynpyn0l77m94b50g7ysl795nvam3ra65wx5zb46nxspgbf6wnkh";
3637 };
3738
38− nativeBuildInputs = [ pkgconfig python makeWrapper ];
39+ nativeBuildInputs = [ pkgconfig python makeWrapper wafHook ];
3940 buildInputs = [ libsamplerate libsndfile readline eigen celt
4041 optDbus optPythonDBus optLibffado optAlsaLib optLibopus
41− ] ++ stdenv.lib.optionals stdenv.isDarwin [ aften AudioToolbox CoreAudio CoreFoundation ];
42+ ] ++ optionals stdenv.isDarwin [ aften AudioToolbox CoreAudio CoreFoundation ];
4243
4344 # CoreFoundation 10.10 doesn't include CFNotificationCenter.h yet.
44− patches = stdenv.lib.optionals stdenv.isDarwin [ ./darwin-cf.patch ];
45+ patches = optionals stdenv.isDarwin [ ./darwin-cf.patch ];
4546
4647 prePatch = ''
4748 substituteInPlace svnversion_regenerate.sh \
@@ -51,30 +52,18 @@ stdenv.mkDerivation rec {
5152 # It looks like one of the frameworks depends on <CoreFoundation/CFAttributedString.h>
5253 # since frameworks are impure we also have to use the impure CoreFoundation here.
5354 # FIXME: remove when CoreFoundation is updated to 10.11
54− preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
55+ preConfigure = optionalString stdenv.isDarwin ''
5556 export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
5657 '';
5758
58− configurePhase = ''
59− runHook preConfigure
59+ configureFlags = [
60+ "--classic"
61+ "--autostart=${if (optDbus != null) then "dbus" else "classic"}"
62+ ] ++ optional (optDbus != null) "--dbus"
63+ ++ optional (optLibffado != null) "--firewire"
64+ ++ optional (optAlsaLib != null) "--alsa";
6065
61− python waf configure --prefix=$out \
62− ${optionalString (optDbus != null) "--dbus"} \
63− --classic \
64− ${optionalString (optLibffado != null) "--firewire"} \
65− ${optionalString (optAlsaLib != null) "--alsa"} \
66− --autostart=${if (optDbus != null) then "dbus" else "classic"} \
67−
68− runHook postConfigure
69− '';
70−
71− buildPhase = ''
72− python waf build
73− '';
74−
75− installPhase = ''
76− python waf install
77− '' + (if libOnly then ''
66+ postInstall = (if libOnly then ''
7867 rm -rf $out/{bin,share}
7968 rm -rf $out/lib/{jack,libjacknet*,libjackserver*}
8069 '' else ''