2010-08-22 14:08:55 +02:00
|
|
|
{ stdenv, fetchurl, alsaLib, pkgconfig }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2012-04-05 10:22:35 +02:00
|
|
|
name = "portaudio-19-20111121";
|
|
|
|
|
2010-08-22 14:08:55 +02:00
|
|
|
src = fetchurl {
|
2012-04-05 10:22:35 +02:00
|
|
|
url = http://www.portaudio.com/archives/pa_stable_v19_20111121.tgz;
|
|
|
|
sha256 = "168vmcag3c5y3zwf7h5298ydh83g72q5bznskrw9cr2h1lrx29lw";
|
2010-08-22 14:08:55 +02:00
|
|
|
};
|
|
|
|
|
2013-07-06 09:56:54 +02:00
|
|
|
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 <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
|
|
|
|
installPhase = if stdenv.isDarwin then ''
|
|
|
|
mkdir -p "$out"
|
|
|
|
cp -r include "$out"
|
|
|
|
cp -r lib "$out"
|
|
|
|
'' else ''
|
|
|
|
make install
|
|
|
|
'';
|
|
|
|
|
|
|
|
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-06 09:56:54 +02:00
|
|
|
license = licenses.bsd;
|
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
|
|
|
platforms = platforms.unix;
|
2010-08-22 14:08:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
api_version = 19;
|
|
|
|
};
|
|
|
|
}
|