2017-01-04 20:23:02 +01:00
|
|
|
{ stdenv, fetchurl, alsaLib, pkgconfig
|
|
|
|
, AudioUnit, AudioToolbox, CoreAudio, CoreServices, Carbon }:
|
2010-08-22 14:08:55 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-11-25 07:52:56 +01:00
|
|
|
name = "portaudio-19-20140130";
|
|
|
|
|
2010-08-22 14:08:55 +02:00
|
|
|
src = fetchurl {
|
2016-11-25 07:52:56 +01:00
|
|
|
url = http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz;
|
2014-02-11 08:56:37 +01:00
|
|
|
sha256 = "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g";
|
2010-08-22 14:08:55 +02:00
|
|
|
};
|
|
|
|
|
2013-07-06 09:56:54 +02:00
|
|
|
buildInputs = [ pkgconfig ]
|
|
|
|
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
|
|
|
|
|
2017-01-04 20:23:02 +01:00
|
|
|
configureFlags = [ "--disable-mac-universal" ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
|
2013-07-06 09:56:54 +02:00
|
|
|
|
|
|
|
preBuild = 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
|
|
|
|
|
|
|
|
# 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
|
2017-01-04 20:23:02 +01:00
|
|
|
installPhase = ''
|
2013-07-06 09:56:54 +02:00
|
|
|
make install
|
2017-01-04 20:23:02 +01:00
|
|
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
2014-07-22 15:29:38 +02:00
|
|
|
# fixup .pc file to find alsa library
|
2015-10-08 11:23:19 +02:00
|
|
|
sed -i "s|-lasound|-L${alsaLib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
|
2017-01-04 20:23:02 +01:00
|
|
|
'' + stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
cp include/pa_mac_core.h $out/include/pa_mac_core.h
|
2013-07-06 09:56:54 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2010-08-22 14:08:55 +02:00
|
|
|
description = "Portable cross-platform Audio API";
|
2013-07-06 09:56:54 +02:00
|
|
|
homepage = http://www.portaudio.com/;
|
2010-08-22 14:08:55 +02:00
|
|
|
# Not exactly a bsd license, but alike
|
2013-07-07 12:51:41 +02:00
|
|
|
license = licenses.mit;
|
2013-07-06 09:56:54 +02:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.unix;
|
2010-08-22 14:08:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
api_version = 19;
|
|
|
|
};
|
|
|
|
}
|