2016-06-26 05:45:55 +01:00
|
|
|
{ stdenv, callPackage, makeWrapper, writeText, CoreServices, ImageIO, CoreGraphics
|
2016-11-06 00:51:15 +00:00
|
|
|
, cctools, bootstrap_cmds, binutils}:
|
2016-06-26 05:45:55 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
toolchainName = "com.apple.dt.toolchain.XcodeDefault";
|
|
|
|
platformName = "com.apple.platform.macosx";
|
2016-11-06 00:51:15 +00:00
|
|
|
sdkName = "macosx10.10";
|
2016-06-26 05:45:55 +01:00
|
|
|
|
|
|
|
xcbuild = callPackage ./default.nix {
|
|
|
|
inherit CoreServices ImageIO CoreGraphics;
|
|
|
|
};
|
|
|
|
|
|
|
|
toolchain = callPackage ./toolchain.nix {
|
2016-11-10 20:53:28 +00:00
|
|
|
inherit cctools bootstrap_cmds toolchainName xcbuild binutils stdenv;
|
2016-06-26 05:45:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
sdk = callPackage ./sdk.nix {
|
|
|
|
inherit toolchainName sdkName xcbuild;
|
|
|
|
};
|
|
|
|
|
|
|
|
platform = callPackage ./platform.nix {
|
|
|
|
inherit sdk platformName xcbuild;
|
|
|
|
};
|
|
|
|
|
|
|
|
developer = callPackage ./developer.nix {
|
|
|
|
inherit platform toolchain xcbuild;
|
|
|
|
};
|
|
|
|
|
|
|
|
xcconfig = writeText "nix.xcconfig" ''
|
2016-11-06 00:51:15 +00:00
|
|
|
SDKROOT=${sdkName}
|
2016-06-26 05:45:55 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "xcbuild-wrapper";
|
|
|
|
|
|
|
|
buildInputs = [ xcbuild makeWrapper ];
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
|
|
|
phases = [ "installPhase" "fixupPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cd $out/bin/
|
|
|
|
|
|
|
|
for file in ${xcbuild}/bin/*; do
|
|
|
|
ln -s $file
|
|
|
|
done
|
|
|
|
|
|
|
|
wrapProgram $out/bin/xcodebuild \
|
|
|
|
--add-flags "-xcconfig ${xcconfig}" \
|
|
|
|
--add-flags "DERIVED_DATA_DIR=." \
|
|
|
|
--set DEVELOPER_DIR "${developer}"
|
|
|
|
wrapProgram $out/bin/xcrun \
|
|
|
|
--add-flags "-sdk ${sdkName}" \
|
|
|
|
--set DEVELOPER_DIR "${developer}"
|
|
|
|
'';
|
|
|
|
|
2016-11-02 05:17:58 +00:00
|
|
|
passthru = {
|
|
|
|
raw = xcbuild;
|
|
|
|
};
|
|
|
|
|
2016-06-26 05:45:55 +01:00
|
|
|
preferLocalBuild = true;
|
|
|
|
}
|