diff options
author | aszlig <aszlig@redmoonstudios.org> | 2014-03-10 03:39:33 +0100 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2014-03-12 10:00:43 +0100 |
commit | 83dd414ca221a8aff18a03b3ef9716fe0ca7d06d (patch) | |
tree | da3f357d87665184da2a30a1bc27d61e21bae95b /pkgs/os-specific | |
parent | 5e565754abcfcb726510e2f6c205b5b6bd0e091f (diff) | |
download | nixlib-83dd414ca221a8aff18a03b3ef9716fe0ca7d06d.tar nixlib-83dd414ca221a8aff18a03b3ef9716fe0ca7d06d.tar.gz nixlib-83dd414ca221a8aff18a03b3ef9716fe0ca7d06d.tar.bz2 nixlib-83dd414ca221a8aff18a03b3ef9716fe0ca7d06d.tar.lz nixlib-83dd414ca221a8aff18a03b3ef9716fe0ca7d06d.tar.xz nixlib-83dd414ca221a8aff18a03b3ef9716fe0ca7d06d.tar.zst nixlib-83dd414ca221a8aff18a03b3ef9716fe0ca7d06d.zip |
Add new package for Apple's XCode.
This package provides the SDK and standard library needed for cross-compiling to Mac US X. We're using xpwn here to extract the DMG. Also, this version (XCode 5.0.2) only contains the SDKs for version 10.9 and 10.8, so we might need to add requireFile directives for older versions as well. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/darwin/xcode/default.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/os-specific/darwin/xcode/default.nix b/pkgs/os-specific/darwin/xcode/default.nix new file mode 100644 index 000000000000..671e73a0fa52 --- /dev/null +++ b/pkgs/os-specific/darwin/xcode/default.nix @@ -0,0 +1,37 @@ +{ stdenv, requireFile, xpwn }: + +stdenv.mkDerivation rec { + name = "xcode-${version}"; + version = "5.0.2"; + + src = requireFile { + name = "xcode_${version}.dmg"; + url = meta.homepage; + sha256 = "0mrligqkfqwx8cy883pxm4w5w7a17nfh227zdspfll23r9agf32k"; + }; + + phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; + + unpackCmd = let + basePath = "Xcode.app/Contents/Developer/Platforms/MacOSX.platform"; + sdkPath = "${basePath}/Developer/SDKs"; + in '' + ${xpwn}/bin/dmg extract "$curSrc" main.hfs > /dev/null + ${xpwn}/bin/hfsplus main.hfs extractall "${sdkPath}" > /dev/null + ''; + + setSourceRoot = "sourceRoot=MacOSX10.9.sdk"; + + installPhase = '' + ensureDir "$out/share/sysroot" + cp -a * "$out/share/sysroot/" + ln -s "$out/usr/lib" "$out/lib" + ln -s "$out/usr/include" "$out/include" + ''; + + meta = { + homepage = "https://developer.apple.com/downloads/"; + description = "Apple's XCode SDK"; + license = stdenv.lib.licenses.unfree; + }; +} |