@@ -1,6 +1,9 @@
1−{ stdenv, fetchurl, pkgconfig, libsndfile }:
1+{ stdenv, fetchurl, pkgconfig, libsndfile, ApplicationServices, Carbon, CoreServices }:
22
3−stdenv.mkDerivation rec {
3+let
4+ inherit (stdenv.lib) optionals optionalString;
5+
6+in stdenv.mkDerivation rec {
47 name = "libsamplerate-0.1.8";
58
69 src = fetchurl {
@@ -9,7 +12,8 @@ stdenv.mkDerivation rec {
912 };
1013
1114 nativeBuildInputs = [ pkgconfig ];
12− buildInputs = [ libsndfile ];
15+ buildInputs = [ libsndfile ]
16+ ++ optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
1317
1418 # maybe interesting configure flags:
1519 #--disable-fftw disable usage of FFTW
@@ -17,14 +21,13 @@ stdenv.mkDerivation rec {
1721
1822 outputs = [ "dev" "bin" "out" ];
1923
20− postConfigure = stdenv.lib.optionalString stdenv.isDarwin
21− ''
22− # need headers from the Carbon.framework in /System/Library/Frameworks to
23− # compile this on darwin -- not sure how to handle
24− NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
24+ postConfigure = optionalString stdenv.isDarwin ''
25+ # need headers from the Carbon.framework in /System/Library/Frameworks to
26+ # compile this on darwin -- not sure how to handle
27+ NIX_CFLAGS_COMPILE+=" -I${Carbon}/Library/Frameworks/Carbon.framework/Headers"
2528
26− substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
27− '';
29+ substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
30+ '';
2831
2932 meta = with stdenv.lib; {
3033 description = "Sample Rate Converter for audio";