diff --git a/pkgs/development/libraries/portaudio/default.nix b/pkgs/development/libraries/portaudio/default.nix index 89361bf31216..36e2e10ee083 100644 --- a/pkgs/development/libraries/portaudio/default.nix +++ b/pkgs/development/libraries/portaudio/default.nix @@ -8,13 +8,40 @@ stdenv.mkDerivation rec { sha256 = "168vmcag3c5y3zwf7h5298ydh83g72q5bznskrw9cr2h1lrx29lw"; }; - buildInputs = [ alsaLib pkgconfig ]; - - meta = { + buildInputs = [ pkgconfig ] + ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib; + + configureFlags = stdenv.lib.optionals stdenv.isDarwin + [ "--build=x86_64" "--without-oss" "--enable-static" "--enable-shared" ]; + + preBuild = stdenv.lib.optionalString stdenv.isDarwin '' + sed -i '50 i\ + #include \ + #include \ + #include ' \ + include/pa_mac_core.h + + # disable two tests that don't compile + sed -i -e 105d Makefile + sed -i -e 107d Makefile + ''; + + # not sure why, but all the headers seem to be installed by the make install + installPhase = if stdenv.isDarwin then '' + mkdir -p "$out" + cp -r include "$out" + cp -r lib "$out" + '' else '' + make install + ''; + + meta = with stdenv.lib; { description = "Portable cross-platform Audio API"; - homepage = http://www.portaudio.com/; + homepage = http://www.portaudio.com/; # Not exactly a bsd license, but alike - license = "BSD"; + license = licenses.bsd; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.unix; }; passthru = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 44df80361af7..eb7a79c7f699 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5149,7 +5149,13 @@ let popt = callPackage ../development/libraries/popt { }; - portaudio = callPackage ../development/libraries/portaudio { }; + portaudio = callPackage ../development/libraries/portaudio { + # resolves a variety of compile-time errors + stdenv = if stdenv.isDarwin + then clangStdenv + else stdenv; + }; + portaudioSVN = callPackage ../development/libraries/portaudio/svn-head.nix { }; prison = callPackage ../development/libraries/prison { };