about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/darwin/usr-include/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/os-specific/darwin/usr-include/default.nix')
-rw-r--r--nixpkgs/pkgs/os-specific/darwin/usr-include/default.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/darwin/usr-include/default.nix b/nixpkgs/pkgs/os-specific/darwin/usr-include/default.nix
new file mode 100644
index 000000000000..26b60ea44f5d
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/darwin/usr-include/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, darwin}:
+
+/*
+ * This is needed to build GCC on Darwin.
+ *
+ * These are the collection of headers that would normally be available under
+ * /usr/include in macOS machines with command line tools installed. They need
+ * to be in one folder for gcc to use them correctly.
+ */
+
+stdenv.mkDerivation {
+  name = "darwin-usr-include";
+  buildInputs = [ darwin.CF stdenv.libc ];
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    ln -sf ${stdenv.libc}/include/* .
+    mkdir CoreFoundation
+    ln -sf ${darwin.CF}/Library/Frameworks/CoreFoundation.framework/Headers/* CoreFoundation
+  '';
+
+  meta.platforms = lib.platforms.darwin;
+}