summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorAndrew Childs <lorne@cons.org.nz>2020-11-19 17:27:27 +0900
committerAndrew Childs <lorne@cons.org.nz>2021-05-17 00:27:01 +0900
commita7bcb6b93683dd9e2bbaabd8f06d56a2301f3410 (patch)
tree602df99fc3d0039f0e2fbd365c40a33493dfca89 /pkgs
parent9e05276949045b8620a0ebd7de3aa75bb6af21cc (diff)
darwin cross: include CoreFoundation in stdenv
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/stdenv/cross/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix13
2 files changed, 15 insertions, 2 deletions
diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix
index a9fd21534ff4c..18a6e2a473727 100644
--- a/pkgs/stdenv/cross/default.nix
+++ b/pkgs/stdenv/cross/default.nix
@@ -48,7 +48,9 @@ in lib.init bootStages ++ [
       # Prior overrides are surely not valid as packages built with this run on
       # a different platform, and so are disabled.
       overrides = _: _: {};
-      extraBuildInputs = [ ]; # Old ones run on wrong platform
+      extraBuildInputs = [ ] # Old ones run on wrong platform
+         ++ lib.optionals hostPlatform.isDarwin [ buildPackages.targetPackages.darwin.apple_sdk.frameworks.CoreFoundation ]
+         ;
       allowedRequisites = null;
 
       hasCC = !targetPlatform.isGhcjs;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 99169c488027e..a9da6ce07074f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -30,7 +30,18 @@ in
   # just the plain stdenv.
   stdenv_32bit = lowPrio (if stdenv.hostPlatform.is32bit then stdenv else multiStdenv);
 
-  stdenvNoCC = stdenv.override { cc = null; hasCC = false; };
+  stdenvNoCC = stdenv.override (
+    { cc = null; hasCC = false; }
+
+    // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && (stdenv.hostPlatform != stdenv.buildPlatform)) {
+      # TODO: This is a hack to use stdenvNoCC to produce a CF when cross
+      # compiling. It's not very sound. The cross stdenv has:
+      #   extraBuildInputs = [ targetPackages.darwin.apple_sdks.frameworks.CoreFoundation ]
+      # and uses stdenvNoCC. In order to make this not infinitely recursive, we need to exclude
+      # this extraBuildInput.
+      extraBuildInputs = [];
+    }
+  );
 
   mkStdenvNoLibs = stdenv: let
     bintools = stdenv.cc.bintools.override {