Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl, pkg-config, libsndfile, ApplicationServices, Carbon, CoreServices }: 2 3let 4 inherit (lib) optionals optionalString; 5 6in stdenv.mkDerivation rec { 7 pname = "libsamplerate"; 8 version = "0.1.9"; 9 10 src = fetchurl { 11 url = "http://www.mega-nerd.com/SRC/${pname}-${version}.tar.gz"; 12 sha256 = "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"; 13 }; 14 15 nativeBuildInputs = [ pkg-config ]; 16 buildInputs = [ libsndfile ] 17 ++ optionals stdenv.isDarwin [ ApplicationServices CoreServices ]; 18 19 configureFlags = [ "--disable-fftw" ]; 20 21 outputs = [ "bin" "dev" "out" ]; 22 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" 27 28 substituteInPlace examples/Makefile --replace "-fpascal-strings" "" 29 ''; 30 31 meta = with lib; { 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; 37 }; 38}