2014-03-10 02:39:33 +00:00
|
|
|
{ stdenv, requireFile, xpwn }:
|
|
|
|
|
2014-03-12 05:43:57 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
osxVersion = "10.9";
|
|
|
|
in stdenv.mkDerivation rec {
|
2014-03-10 02:39:33 +00:00
|
|
|
name = "xcode-${version}";
|
2014-03-12 08:12:10 +00:00
|
|
|
version = "5.1";
|
2014-03-10 02:39:33 +00:00
|
|
|
|
|
|
|
src = requireFile {
|
|
|
|
name = "xcode_${version}.dmg";
|
|
|
|
url = meta.homepage;
|
2014-04-01 00:34:07 +01:00
|
|
|
sha256 = "70bb550cc14eca80b9825f4ae9bfbf7f076bb75777311be428bc30a7eb7a6f7e";
|
2014-03-10 02:39:33 +00:00
|
|
|
};
|
|
|
|
|
2014-03-12 05:43:57 +00:00
|
|
|
phases = [ "unpackPhase" "patchPhase" "installPhase" "fixupPhase" ];
|
2014-03-10 20:46:09 +00:00
|
|
|
outputs = [ "out" "toolchain" ];
|
2014-03-10 02:39:33 +00:00
|
|
|
|
2014-03-12 05:43:57 +00:00
|
|
|
|
2014-03-10 02:39:33 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2014-03-12 05:43:57 +00:00
|
|
|
setSourceRoot = "sourceRoot=MacOSX${osxVersion}.sdk";
|
|
|
|
|
|
|
|
patches = optional (osxVersion == "10.9") ./gcc-fix-enum-attributes.patch;
|
2014-03-10 02:39:33 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p "$out/share/sysroot"
|
2014-03-10 02:39:33 +00:00
|
|
|
cp -a * "$out/share/sysroot/"
|
2014-03-10 20:46:09 +00:00
|
|
|
ln -s "$out/share/sysroot/usr/lib" "$out/lib"
|
|
|
|
ln -s "$out/share/sysroot/usr/include" "$out/include"
|
|
|
|
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p "$toolchain"
|
2014-03-10 20:46:09 +00:00
|
|
|
pushd "$toolchain"
|
|
|
|
${xpwn}/bin/hfsplus "$(dirs +1)/../main.hfs" extractall \
|
|
|
|
Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr \
|
|
|
|
> /dev/null
|
|
|
|
popd
|
2014-03-10 02:39:33 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://developer.apple.com/downloads/;
|
2014-03-10 02:39:33 +00:00
|
|
|
description = "Apple's XCode SDK";
|
|
|
|
license = stdenv.lib.licenses.unfree;
|
|
|
|
};
|
|
|
|
}
|