Merge pull request #21681 from matthewbauer/anki

Anki: Darwin support
This commit is contained in:
Daiderd Jordan
2017-01-18 21:41:11 +01:00
committed by GitHub
5 changed files with 32 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
{ stdenv, fetchurl, alsaLib, pkgconfig }:
{ stdenv, fetchurl, alsaLib, pkgconfig
, AudioUnit, AudioToolbox, CoreAudio, CoreServices, Carbon }:
stdenv.mkDerivation rec {
name = "portaudio-19-20140130";
@@ -11,31 +12,26 @@ stdenv.mkDerivation rec {
buildInputs = [ pkgconfig ]
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
configureFlags = stdenv.lib.optionals stdenv.isDarwin
[ "--build=x86_64" "--without-oss" "--enable-static" "--enable-shared" ];
configureFlags = [ "--disable-mac-universal" ];
preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
patchPhase = 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 ''
installPhase = ''
make install
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
# fixup .pc file to find alsa library
sed -i "s|-lasound|-L${alsaLib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
'' + stdenv.lib.optionalString stdenv.isDarwin ''
cp include/pa_mac_core.h $out/include/pa_mac_core.h
'';
meta = with stdenv.lib; {

View File

@@ -4,7 +4,7 @@
, libmng, which, mesaSupported, mesa, mesa_glu, openssl, dbus, cups, pkgconfig
, libtiff, glib, icu, mysql, postgresql, sqlite, perl, coreutils, libXi
, buildMultimedia ? stdenv.isLinux, alsaLib, gstreamer, gst_plugins_base
, buildWebkit ? stdenv.isLinux
, buildWebkit ? (stdenv.isLinux || stdenv.isDarwin)
, flashplayerFix ? false, gdk_pixbuf
, gtkStyle ? false, libgnomeui, gtk2, GConf, gnome_vfs
, developerBuild ? false