blob: 98a5513c7e7a4e1622409ec3944ea566480cfde1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
{ stdenv, fetchurl, alsaLib, pkgconfig }:
stdenv.mkDerivation rec {
name = "portaudio-19-20161030";
src = fetchurl {
url = http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz;
sha256 = "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g";
};
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
# fixup .pc file to find alsa library
sed -i "s|-lasound|-L${alsaLib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
'';
meta = with stdenv.lib; {
description = "Portable cross-platform Audio API";
homepage = http://www.portaudio.com/;
# Not exactly a bsd license, but alike
license = licenses.mit;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
};
passthru = {
api_version = 19;
};
}
|