2017-08-13 00:57:33 +01:00
|
|
|
{ stdenv, fetchurl, alsaLib, pkgconfig, libjack2
|
2017-01-04 19:23:02 +00:00
|
|
|
, AudioUnit, AudioToolbox, CoreAudio, CoreServices, Carbon }:
|
2010-08-22 13:08:55 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-08-13 00:57:33 +01:00
|
|
|
name = "portaudio-190600-20161030";
|
|
|
|
|
2010-08-22 13:08:55 +01:00
|
|
|
src = fetchurl {
|
2017-08-13 00:57:33 +01:00
|
|
|
url = http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz;
|
|
|
|
sha256 = "04qmin6nj144b8qb9kkd9a52xfvm0qdgm8bg8jbl7s3frmyiv8pm";
|
2010-08-22 13:08:55 +01:00
|
|
|
};
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ libjack2 ]
|
2013-07-06 08:56:54 +01:00
|
|
|
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
|
|
|
|
|
2017-05-06 13:54:29 +01:00
|
|
|
configureFlags = [ "--disable-mac-universal --enable-cxx" ];
|
2017-01-04 19:23:02 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
|
2013-07-06 08:56:54 +01:00
|
|
|
|
2017-01-05 19:49:44 +00:00
|
|
|
patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
|
2013-07-06 08:56:54 +01:00
|
|
|
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 = ''
|
2013-07-06 08:56:54 +01:00
|
|
|
make install
|
2017-01-04 19:23:02 +00:00
|
|
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
2014-07-22 14:29:38 +01:00
|
|
|
# fixup .pc file to find alsa library
|
2015-10-08 10:23:19 +01:00
|
|
|
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
|
2013-07-06 08:56:54 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2010-08-22 13:08:55 +01:00
|
|
|
description = "Portable cross-platform Audio API";
|
2013-07-06 08:56:54 +01:00
|
|
|
homepage = http://www.portaudio.com/;
|
2010-08-22 13:08:55 +01:00
|
|
|
# Not exactly a bsd license, but alike
|
2013-07-07 11:51:41 +01:00
|
|
|
license = licenses.mit;
|
2013-07-06 08:56:54 +01:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.unix;
|
2010-08-22 13:08:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
api_version = 19;
|
|
|
|
};
|
|
|
|
}
|