1 { lib, stdenv, fetchurl, pkg-config, libsndfile, ApplicationServices, Carbon, CoreServices }:
4 inherit (lib) optionals optionalString;
6 in stdenv.mkDerivation rec {
7 pname = "libsamplerate";
11 url = "http://www.mega-nerd.com/SRC/${pname}-${version}.tar.gz";
12 sha256 = "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha";
15 nativeBuildInputs = [ pkg-config ];
16 buildInputs = [ libsndfile ]
17 ++ optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
19 configureFlags = [ "--disable-fftw" ];
21 outputs = [ "bin" "dev" "out" ];
23 postConfigure = optionalString stdenv.isDarwin ''
24 # need headers from the Carbon.framework in /System/Library/Frameworks to
25 # compile this on darwin -- not sure how to handle
26 NIX_CFLAGS_COMPILE+=" -I${Carbon}/Library/Frameworks/Carbon.framework/Headers"
28 substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
32 description = "Sample Rate Converter for audio";
33 homepage = "http://www.mega-nerd.com/SRC/index.html";
34 license = licenses.bsd2;
35 maintainers = with maintainers; [ lovek323 ];
36 platforms = platforms.all;