summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/xcode
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-03-10 21:46:09 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-03-12 10:00:45 +0100
commitc0d55fcc6ab1ac2c634e2b518440b26378b7abd7 (patch)
tree33f1d1127cb42fcf504a3e53bfe9e944d0a6e7bd /pkgs/os-specific/darwin/xcode
parenta9ef42f33ca4ea209c810ee42bf801eb485c68ad (diff)
downloadnixpkgs-c0d55fcc6ab1ac2c634e2b518440b26378b7abd7.tar
nixpkgs-c0d55fcc6ab1ac2c634e2b518440b26378b7abd7.tar.gz
nixpkgs-c0d55fcc6ab1ac2c634e2b518440b26378b7abd7.tar.bz2
nixpkgs-c0d55fcc6ab1ac2c634e2b518440b26378b7abd7.tar.lz
nixpkgs-c0d55fcc6ab1ac2c634e2b518440b26378b7abd7.tar.xz
nixpkgs-c0d55fcc6ab1ac2c634e2b518440b26378b7abd7.tar.zst
nixpkgs-c0d55fcc6ab1ac2c634e2b518440b26378b7abd7.zip
xcode: Provide the commandline toolchain as well.
This toolchain contains Mach-O binaries and might not be useful in the
first place, but there are programs like dsymutil, where Apple didn't
release the source code, so we need a Mach-O loader...

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/os-specific/darwin/xcode')
-rw-r--r--pkgs/os-specific/darwin/xcode/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/os-specific/darwin/xcode/default.nix b/pkgs/os-specific/darwin/xcode/default.nix
index 671e73a0fa5..5c8e7a3ef6c 100644
--- a/pkgs/os-specific/darwin/xcode/default.nix
+++ b/pkgs/os-specific/darwin/xcode/default.nix
@@ -11,6 +11,7 @@ stdenv.mkDerivation rec {
   };
 
   phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+  outputs = [ "out" "toolchain" ];
 
   unpackCmd = let
     basePath = "Xcode.app/Contents/Developer/Platforms/MacOSX.platform";
@@ -25,8 +26,15 @@ stdenv.mkDerivation rec {
   installPhase = ''
     ensureDir "$out/share/sysroot"
     cp -a * "$out/share/sysroot/"
-    ln -s "$out/usr/lib" "$out/lib"
-    ln -s "$out/usr/include" "$out/include"
+    ln -s "$out/share/sysroot/usr/lib" "$out/lib"
+    ln -s "$out/share/sysroot/usr/include" "$out/include"
+
+    ensureDir "$toolchain"
+    pushd "$toolchain"
+    ${xpwn}/bin/hfsplus "$(dirs +1)/../main.hfs" extractall \
+      Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr \
+      > /dev/null
+    popd
   '';
 
   meta = {