2020-04-24 23:36:52 +00:00
|
|
|
{ runCommand, lib, toolchainName, sdkName
|
2023-04-29 16:46:19 +00:00
|
|
|
, writeText, xcodePlatform, sdkVer, productBuildVer }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2023-02-02 18:25:31 +00:00
|
|
|
inherit (lib.generators) toPlist toJSON;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
SDKSettings = {
|
|
|
|
CanonicalName = sdkName;
|
|
|
|
DisplayName = sdkName;
|
|
|
|
Toolchains = [ toolchainName ];
|
2023-04-29 16:46:19 +00:00
|
|
|
Version = sdkVer;
|
|
|
|
MaximumDeploymentTarget = sdkVer;
|
2020-04-24 23:36:52 +00:00
|
|
|
isBaseSDK = "YES";
|
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
SystemVersion = lib.optionalAttrs (productBuildVer != null) {
|
|
|
|
ProductBuildVersion = productBuildVer;
|
|
|
|
} // {
|
2020-04-24 23:36:52 +00:00
|
|
|
ProductName = "Mac OS X";
|
2023-04-29 16:46:19 +00:00
|
|
|
ProductVersion = sdkVer;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
runCommand "SDKs" {} ''
|
|
|
|
sdk=$out/${sdkName}.sdk
|
|
|
|
install -D ${writeText "SDKSettings.plist" (toPlist {} SDKSettings)} $sdk/SDKSettings.plist
|
2023-02-02 18:25:31 +00:00
|
|
|
install -D ${writeText "SDKSettings.json" (toJSON {} SDKSettings)} $sdk/SDKSettings.json
|
2020-04-24 23:36:52 +00:00
|
|
|
install -D ${writeText "SystemVersion.plist" (toPlist {} SystemVersion)} $sdk/System/Library/CoreServices/SystemVersion.plist
|
|
|
|
ln -s $sdk $sdk/usr
|
|
|
|
|
|
|
|
ln -s $sdk $out/${xcodePlatform}.sdk
|
|
|
|
''
|