about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2016-08-09 08:13:11 +0200
committerGitHub <noreply@github.com>2016-08-09 08:13:11 +0200
commitc31f05e063bdb3152f4cdd6ef2e18ee0b9ec0532 (patch)
tree5a86acfce7de98d1f451a2042d18fa1421923d2c
parent0b8bde0b63f012f1cc880728b3f1097fba553cfa (diff)
parente2fdd74a41fb8859f72e4f26636df79b046caee5 (diff)
downloadnixlib-c31f05e063bdb3152f4cdd6ef2e18ee0b9ec0532.tar
nixlib-c31f05e063bdb3152f4cdd6ef2e18ee0b9ec0532.tar.gz
nixlib-c31f05e063bdb3152f4cdd6ef2e18ee0b9ec0532.tar.bz2
nixlib-c31f05e063bdb3152f4cdd6ef2e18ee0b9ec0532.tar.lz
nixlib-c31f05e063bdb3152f4cdd6ef2e18ee0b9ec0532.tar.xz
nixlib-c31f05e063bdb3152f4cdd6ef2e18ee0b9ec0532.tar.zst
nixlib-c31f05e063bdb3152f4cdd6ef2e18ee0b9ec0532.zip
Merge pull request #17577 from LnL7/darwin-ffmpeg
ffmpeg: add extra darwin framework for 3.1
-rw-r--r--pkgs/development/libraries/ffmpeg/3.1.nix7
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix4
-rw-r--r--pkgs/development/libraries/libmikmod/default.nix14
-rw-r--r--pkgs/development/libraries/libsamplerate/default.nix23
-rw-r--r--pkgs/top-level/all-packages.nix10
5 files changed, 37 insertions, 21 deletions
diff --git a/pkgs/development/libraries/ffmpeg/3.1.nix b/pkgs/development/libraries/ffmpeg/3.1.nix
index 25892e186843..84e6f57c523a 100644
--- a/pkgs/development/libraries/ffmpeg/3.1.nix
+++ b/pkgs/development/libraries/ffmpeg/3.1.nix
@@ -1,7 +1,12 @@
-{ callPackage, ... } @ args:
+{ callPackage
+# Darwin frameworks
+, Cocoa, CoreMedia
+, ...
+}@args:
 
 callPackage ./generic.nix (args // rec {
   version = "${branch}.1";
   branch = "3.1";
   sha256 = "1d5knh87cgnla5zawy56gkrpb48qhyiq7i0pm8z9hyx3j05abg55";
+  darwinFrameworks = [ Cocoa CoreMedia ];
 })
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
index 0c4e9df3df19..33ee2f80a6ed 100644
--- a/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -13,7 +13,7 @@
 , optimizationsDeveloper ? true
 , extraWarningsDeveloper ? false
 # Darwin frameworks
-, Cocoa
+, Cocoa, darwinFrameworks ? [ Cocoa ]
 # Inherit generics
 , branch, sha256, version, patches ? [], ...
 }:
@@ -153,7 +153,7 @@ stdenv.mkDerivation rec {
     ++ optionals (!isDarwin && !isArm) [ libvpx libpulseaudio ] # Need to be fixed on Darwin and ARM
     ++ optional ((isLinux || isFreeBSD) && !isArm) libva
     ++ optional isLinux alsaLib
-    ++ optional isDarwin Cocoa
+    ++ optionals isDarwin darwinFrameworks
     ++ optional vdpauSupport libvdpau
     ++ optional sdlSupport SDL;
 
diff --git a/pkgs/development/libraries/libmikmod/default.nix b/pkgs/development/libraries/libmikmod/default.nix
index 0f3ea26eb043..806f0e9cd824 100644
--- a/pkgs/development/libraries/libmikmod/default.nix
+++ b/pkgs/development/libraries/libmikmod/default.nix
@@ -1,6 +1,9 @@
-{ stdenv, fetchurl, texinfo, alsaLib, libpulseaudio }:
+{ stdenv, fetchurl, texinfo, alsaLib, libpulseaudio, CoreAudio }:
 
-stdenv.mkDerivation rec {
+let
+  inherit (stdenv.lib) optional optionals optionalString;
+
+in stdenv.mkDerivation rec {
   name = "libmikmod-3.3.7";
   src = fetchurl {
     url = "mirror://sourceforge/mikmod/${name}.tar.gz";
@@ -8,11 +11,12 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ texinfo ]
-    ++ stdenv.lib.optional stdenv.isLinux [ alsaLib libpulseaudio ];
+    ++ optionals stdenv.isLinux [ alsaLib libpulseaudio ]
+    ++ optional stdenv.isDarwin CoreAudio;
   propagatedBuildInputs =
-    stdenv.lib.optional stdenv.isLinux libpulseaudio;
+    optional stdenv.isLinux libpulseaudio;
 
-  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lasound";
+  NIX_LDFLAGS = optionalString stdenv.isLinux "-lasound";
 
   meta = with stdenv.lib; {
     description = "A library for playing tracker music module files";
diff --git a/pkgs/development/libraries/libsamplerate/default.nix b/pkgs/development/libraries/libsamplerate/default.nix
index f0ff549c7168..771e31f7b79b 100644
--- a/pkgs/development/libraries/libsamplerate/default.nix
+++ b/pkgs/development/libraries/libsamplerate/default.nix
@@ -1,6 +1,9 @@
-{ stdenv, fetchurl, pkgconfig, libsndfile }:
+{ stdenv, fetchurl, pkgconfig, libsndfile, ApplicationServices, Carbon, CoreServices }:
 
-stdenv.mkDerivation rec {
+let
+  inherit (stdenv.lib) optionals optionalString;
+
+in stdenv.mkDerivation rec {
   name = "libsamplerate-0.1.8";
 
   src = fetchurl {
@@ -9,7 +12,8 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libsndfile ];
+  buildInputs = [ libsndfile ]
+    ++ optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
 
   # maybe interesting configure flags:
   #--disable-fftw          disable usage of FFTW
@@ -17,14 +21,13 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "bin" "out" ];
 
-  postConfigure = stdenv.lib.optionalString stdenv.isDarwin
-    ''
-      # need headers from the Carbon.framework in /System/Library/Frameworks to
-      # compile this on darwin -- not sure how to handle
-      NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
+  postConfigure = optionalString stdenv.isDarwin ''
+    # need headers from the Carbon.framework in /System/Library/Frameworks to
+    # compile this on darwin -- not sure how to handle
+    NIX_CFLAGS_COMPILE+=" -I${Carbon}/Library/Frameworks/Carbon.framework/Headers"
 
-      substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
-    '';
+    substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
+  '';
 
   meta = with stdenv.lib; {
     description = "Sample Rate Converter for audio";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 054193c73646..d89c076a14ad 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7172,7 +7172,7 @@ in
     inherit (darwin.apple_sdk.frameworks) Cocoa;
   };
   ffmpeg_3_1 = callPackage ../development/libraries/ffmpeg/3.1.nix {
-    inherit (darwin.apple_sdk.frameworks) Cocoa;
+    inherit (darwin.apple_sdk.frameworks) Cocoa CoreMedia;
   };
   # Aliases
   ffmpeg_0 = self.ffmpeg_0_10;
@@ -8203,7 +8203,9 @@ in
 
   librevisa = callPackage ../development/libraries/librevisa { };
 
-  libsamplerate = callPackage ../development/libraries/libsamplerate { };
+  libsamplerate = callPackage ../development/libraries/libsamplerate {
+    inherit (darwin.apple_sdk.frameworks) ApplicationServices Carbon CoreServices;
+  };
 
   libsieve = callPackage ../development/libraries/libsieve { };
 
@@ -8292,7 +8294,9 @@ in
 
   libmicrohttpd = callPackage ../development/libraries/libmicrohttpd { };
 
-  libmikmod = callPackage ../development/libraries/libmikmod { };
+  libmikmod = callPackage ../development/libraries/libmikmod {
+    inherit (darwin.apple_sdk.frameworks) CoreAudio;
+  };
 
   libmilter = callPackage ../development/libraries/libmilter { };