2019-06-16 19:59:06 +00:00
|
|
|
{ runCommand, lib, toolchainName, sdkName
|
2023-04-16 10:38:30 +00:00
|
|
|
, writeText, xcodePlatform, sdkVer, productBuildVer }:
|
2016-06-26 04:45:55 +00:00
|
|
|
|
|
|
|
let
|
2022-09-14 18:14:16 +00:00
|
|
|
inherit (lib.generators) toPlist toJSON;
|
2018-06-27 19:36:00 +00:00
|
|
|
|
2016-06-26 04:45:55 +00:00
|
|
|
SDKSettings = {
|
|
|
|
CanonicalName = sdkName;
|
|
|
|
DisplayName = sdkName;
|
|
|
|
Toolchains = [ toolchainName ];
|
2023-04-16 10:38:30 +00:00
|
|
|
Version = sdkVer;
|
|
|
|
MaximumDeploymentTarget = sdkVer;
|
2016-06-26 04:45:55 +00:00
|
|
|
isBaseSDK = "YES";
|
|
|
|
};
|
|
|
|
|
2023-04-16 10:38:30 +00:00
|
|
|
SystemVersion = lib.optionalAttrs (productBuildVer != null) {
|
|
|
|
ProductBuildVersion = productBuildVer;
|
|
|
|
} // {
|
2016-06-26 04:45:55 +00:00
|
|
|
ProductName = "Mac OS X";
|
2023-04-16 10:38:30 +00:00
|
|
|
ProductVersion = sdkVer;
|
2016-06-26 04:45:55 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2018-07-11 15:45:23 +00:00
|
|
|
runCommand "SDKs" {} ''
|
2018-07-06 22:49:38 +00:00
|
|
|
sdk=$out/${sdkName}.sdk
|
|
|
|
install -D ${writeText "SDKSettings.plist" (toPlist {} SDKSettings)} $sdk/SDKSettings.plist
|
2022-09-14 18:14:16 +00:00
|
|
|
install -D ${writeText "SDKSettings.json" (toJSON {} SDKSettings)} $sdk/SDKSettings.json
|
2018-07-06 22:49:38 +00:00
|
|
|
install -D ${writeText "SystemVersion.plist" (toPlist {} SystemVersion)} $sdk/System/Library/CoreServices/SystemVersion.plist
|
2018-07-11 15:45:23 +00:00
|
|
|
ln -s $sdk $sdk/usr
|
|
|
|
|
2018-07-06 22:49:38 +00:00
|
|
|
ln -s $sdk $out/${xcodePlatform}.sdk
|
2018-06-27 19:36:00 +00:00
|
|
|
''
|