summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/usr-include
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2016-09-14 22:19:28 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2016-09-15 17:58:09 -0500
commit8610a344740776639f7161e5a47196418695d6fe (patch)
treeee82e373db5d6b82e9f508c4504541392bad9c22 /pkgs/os-specific/darwin/usr-include
parentc7e0fbcbc80c402ce53a9677b11a01d792b80c0d (diff)
downloadnixpkgs-8610a344740776639f7161e5a47196418695d6fe.tar
nixpkgs-8610a344740776639f7161e5a47196418695d6fe.tar.gz
nixpkgs-8610a344740776639f7161e5a47196418695d6fe.tar.bz2
nixpkgs-8610a344740776639f7161e5a47196418695d6fe.tar.lz
nixpkgs-8610a344740776639f7161e5a47196418695d6fe.tar.xz
nixpkgs-8610a344740776639f7161e5a47196418695d6fe.tar.zst
nixpkgs-8610a344740776639f7161e5a47196418695d6fe.zip
gcc: use special native system headers for darwin
Darwin systems need to be able to find CoreFoundation headers as well as
libc headers. Somehow, gcc doesn't accept any "framework" parameters
that would normally be used to include CoreFoundation in this
situation.

HACK: Instead, this adds a derivation that combines the two. The result
works but probably not a good long term solution.

ALTERNATIVES: Maybe sending patches in to GCC to allow
"native-system-framework" configure flag to get this found.
Diffstat (limited to 'pkgs/os-specific/darwin/usr-include')
-rw-r--r--pkgs/os-specific/darwin/usr-include/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/usr-include/default.nix b/pkgs/os-specific/darwin/usr-include/default.nix
new file mode 100644
index 00000000000..c5f7e3acce7
--- /dev/null
+++ b/pkgs/os-specific/darwin/usr-include/default.nix
@@ -0,0 +1,21 @@
+{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 OS X 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
+  '';
+}