2021-01-21 18:00:13 +01:00
|
|
|
{ lib, stdenv, fetchurl, alsaLib, pkg-config, libjack2
|
2017-01-04 20:23:02 +01:00
|
|
|
, AudioUnit, AudioToolbox, CoreAudio, CoreServices, Carbon }:
|
2010-08-22 14:08:55 +02:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2017-08-13 01:57:33 +02:00
|
|
|
name = "portaudio-190600-20161030";
|
|
|
|
|
2010-08-22 14:08:55 +02:00
|
|
|
src = fetchurl {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz";
|
2017-08-13 01:57:33 +02:00
|
|
|
sha256 = "04qmin6nj144b8qb9kkd9a52xfvm0qdgm8bg8jbl7s3frmyiv8pm";
|
2010-08-22 14:08:55 +02:00
|
|
|
};
|
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 23:26:13 +02:00
|
|
|
buildInputs = [ libjack2 ]
|
2021-01-21 18:00:13 +01:00
|
|
|
++ lib.optional (!stdenv.isDarwin) alsaLib;
|
2013-07-06 09:56:54 +02:00
|
|
|
|
2019-11-20 10:17:54 +01:00
|
|
|
configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];
|
2017-01-04 20:23:02 +01:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays";
|
2019-05-12 05:00:56 +02:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
|
2013-07-06 09:56:54 +02:00
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
patchPhase = lib.optionalString stdenv.isDarwin ''
|
2013-07-06 09:56:54 +02: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 20:23:02 +01:00
|
|
|
installPhase = ''
|
2013-07-06 09:56:54 +02:00
|
|
|
make install
|
2021-01-21 18:00:13 +01:00
|
|
|
'' + 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
|
2021-01-21 18:00:13 +01:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2017-01-04 20:23:02 +01:00
|
|
|
cp include/pa_mac_core.h $out/include/pa_mac_core.h
|
2013-07-06 09:56:54 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2010-08-22 14:08:55 +02:00
|
|
|
description = "Portable cross-platform Audio API";
|
2020-04-01 03:11:51 +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;
|
|
|
|
};
|
|
|
|
}
|