From 0ede72738db3f62597d0fc8d4a22b3d33f987c5f Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 4 Jan 2017 13:20:42 -0600 Subject: [PATCH 1/5] mplayer: add darwin platform --- pkgs/applications/video/mplayer/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 3a270da21e97..60625412617a 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -199,6 +199,6 @@ stdenv.mkDerivation rec { homepage = "http://mplayerhq.hu"; license = "GPL"; maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.urkud ]; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; }; } From 5c09b223f9aca13a793935142f29cf98151ee360 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 4 Jan 2017 13:21:48 -0600 Subject: [PATCH 2/5] pulseaudio: fix on Darwin --- pkgs/servers/pulseaudio/default.nix | 11 +++++++++-- pkgs/top-level/all-packages.nix | 10 ++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index efa5d71a76f1..09be8c7c587b 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, pkgconfig, intltool, autoreconfHook +{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, intltool, autoreconfHook , json_c, libsndfile, libtool , xorg, libcap, alsaLib, glib , avahi, libjack2, libasyncns, lirc, dbus @@ -30,6 +30,8 @@ , # Whether to build only the library. libOnly ? false + +, CoreServices, AudioUnit, Cocoa }: stdenv.mkDerivation rec { @@ -41,7 +43,11 @@ stdenv.mkDerivation rec { sha256 = "11j682g2mn723sz3bh4i44ggq29z053zcggy0glzn63zh9mxdly3"; }; - patches = [ ./caps-fix.patch ]; + patches = [ ./caps-fix.patch ] + ++ stdenv.lib.optional stdenv.isDarwin (fetchpatch { + url = "https://bugs.freedesktop.org/attachment.cgi?id=127889"; + sha256 = "063h5vmh4ykgxjbxyxjlj6qhyyxhazbh3p18p1ik69kq24nkny9m"; + }); outputs = [ "out" "dev" ]; @@ -53,6 +59,7 @@ stdenv.mkDerivation rec { buildInputs = [ json_c libsndfile speexdsp fftwFloat ] ++ lib.optionals stdenv.isLinux [ glib dbus ] + ++ lib.optionals stdenv.isDarwin [ CoreServices AudioUnit Cocoa ] ++ lib.optionals (!libOnly) ( [ libasyncns webrtc-audio-processing ] ++ lib.optional jackaudioSupport libjack2 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ac48186d58f7..76f52481fb27 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10315,11 +10315,16 @@ in pshs = callPackage ../servers/http/pshs { }; - libpulseaudio = callPackage ../servers/pulseaudio { libOnly = true; }; + libpulseaudio = callPackage ../servers/pulseaudio { + libOnly = true; + inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; + }; # Name is changed to prevent use in packages; # please use libpulseaudio instead. - pulseaudioLight = callPackage ../servers/pulseaudio { }; + pulseaudioLight = callPackage ../servers/pulseaudio { + inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; + }; pulseaudioFull = callPackage ../servers/pulseaudio { gconf = gnome3.gconf; @@ -10330,6 +10335,7 @@ in bluetoothSupport = true; remoteControlSupport = true; zeroconfSupport = true; + inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; }; tomcat_connectors = callPackage ../servers/http/apache-modules/tomcat-connectors { }; From 6c6db7b58b79436a32022e4dcdda4a07051841f4 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 4 Jan 2017 13:23:02 -0600 Subject: [PATCH 3/5] portaudio: fix on Darwin --- .../libraries/portaudio/default.nix | 18 +++++++++--------- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/portaudio/default.nix b/pkgs/development/libraries/portaudio/default.nix index 5d8c2430ab9f..b2375fb75837 100644 --- a/pkgs/development/libraries/portaudio/default.nix +++ b/pkgs/development/libraries/portaudio/default.nix @@ -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,8 +12,9 @@ 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" ]; + + propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ]; preBuild = stdenv.lib.optionalString stdenv.isDarwin '' sed -i '50 i\ @@ -27,15 +29,13 @@ stdenv.mkDerivation rec { ''; # 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; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 76f52481fb27..4e2b45541249 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8987,7 +8987,9 @@ in popt = callPackage ../development/libraries/popt { }; - portaudio = callPackage ../development/libraries/portaudio { }; + portaudio = callPackage ../development/libraries/portaudio { + inherit (darwin.apple_sdk.frameworks) AudioToolbox AudioUnit CoreAudio CoreServices Carbon; + }; portmidi = callPackage ../development/libraries/portmidi {}; From 74b206bce2ae81d764cb9eb1239818202435fae1 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Wed, 4 Jan 2017 13:23:30 -0600 Subject: [PATCH 4/5] qt4: build webkit on Darwin QtWebkit is needed by Anki --- pkgs/development/libraries/qt-4.x/4.8/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index 8526a5f5b829..91a8899f4d13 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -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 From 2614fa1de05e0dfad6ab717c9b08c55cdd6389ab Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 5 Jan 2017 13:49:44 -0600 Subject: [PATCH 5/5] portaudio: fixup patches - don't use preBuild for patching - leave all of the tests in place (no tests are run anyway) --- pkgs/development/libraries/portaudio/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/development/libraries/portaudio/default.nix b/pkgs/development/libraries/portaudio/default.nix index b2375fb75837..3882e1fb08a2 100644 --- a/pkgs/development/libraries/portaudio/default.nix +++ b/pkgs/development/libraries/portaudio/default.nix @@ -16,16 +16,12 @@ stdenv.mkDerivation rec { propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ]; - preBuild = stdenv.lib.optionalString stdenv.isDarwin '' + patchPhase = stdenv.lib.optionalString stdenv.isDarwin '' sed -i '50 i\ #include \ #include \ #include ' \ 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