2016-06-26 04:45:55 +00:00
|
|
|
{ stdenv, writeText, toolchainName, sdkName, xcbuild }:
|
|
|
|
|
|
|
|
let
|
2018-01-20 19:42:29 +00:00
|
|
|
# TODO: expose MACOSX_DEPLOYMENT_TARGET in nix so we can use it here.
|
|
|
|
version = "10.10";
|
2016-06-26 04:45:55 +00:00
|
|
|
|
|
|
|
SDKSettings = {
|
|
|
|
CanonicalName = sdkName;
|
|
|
|
DisplayName = sdkName;
|
|
|
|
Toolchains = [ toolchainName ];
|
2018-01-20 19:42:29 +00:00
|
|
|
Version = version;
|
|
|
|
MaximumDeploymentTarget = version;
|
2016-06-26 04:45:55 +00:00
|
|
|
isBaseSDK = "YES";
|
|
|
|
};
|
|
|
|
|
|
|
|
SystemVersion = {
|
|
|
|
ProductName = "Mac OS X";
|
2018-01-20 19:42:29 +00:00
|
|
|
ProductVersion = version;
|
2016-06-26 04:45:55 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2018-01-20 19:42:29 +00:00
|
|
|
name = "MacOSX${version}.sdk";
|
|
|
|
inherit version;
|
|
|
|
|
2016-06-26 04:45:55 +00:00
|
|
|
buildInputs = [ xcbuild ];
|
2018-01-20 19:42:29 +00:00
|
|
|
|
2016-06-26 04:45:55 +00:00
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/
|
2016-11-06 00:51:15 +00:00
|
|
|
plutil -convert xml1 -o $out/SDKSettings.plist ${writeText "SDKSettings.json" (builtins.toJSON SDKSettings)}
|
2016-06-26 04:45:55 +00:00
|
|
|
|
|
|
|
mkdir -p $out/System/Library/CoreServices/
|
2016-11-06 00:51:15 +00:00
|
|
|
plutil -convert xml1 -o $out/System/Library/CoreServices/SystemVersion.plist ${writeText "SystemVersion.plist" (builtins.toJSON SystemVersion)}
|
2016-06-26 04:45:55 +00:00
|
|
|
'';
|
|
|
|
}
|