nixpkgs/pkgs/development/libraries/portaudio/default.nix

50 lines
1.6 KiB
Nix
Raw Normal View History

2017-01-04 19:23:02 +00:00
{ stdenv, fetchurl, alsaLib, pkgconfig
, AudioUnit, AudioToolbox, CoreAudio, CoreServices, Carbon }:
stdenv.mkDerivation rec {
name = "portaudio-19-20140130";
src = fetchurl {
url = http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz;
2014-02-11 07:56:37 +00:00
sha256 = "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g";
};
buildInputs = [ pkgconfig ]
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
2017-01-04 19:23:02 +00:00
configureFlags = [ "--disable-mac-universal" ];
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
sed -i '50 i\
#include <CoreAudio/AudioHardware.h>\
#include <CoreAudio/AudioHardwareBase.h>\
#include <CoreAudio/AudioHardwareDeprecated.h>' \
include/pa_mac_core.h
'';
# not sure why, but all the headers seem to be installed by the make install
2017-01-04 19:23:02 +00:00
installPhase = ''
make install
2017-01-04 19:23:02 +00:00
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
# fixup .pc file to find alsa library
sed -i "s|-lasound|-L${alsaLib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
2017-01-04 19:23:02 +00:00
'' + stdenv.lib.optionalString stdenv.isDarwin ''
cp include/pa_mac_core.h $out/include/pa_mac_core.h
'';
meta = with stdenv.lib; {
description = "Portable cross-platform Audio API";
homepage = http://www.portaudio.com/;
# Not exactly a bsd license, but alike
2013-07-07 10:51:41 +00:00
license = licenses.mit;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
};
passthru = {
api_version = 19;
};
}