nixpkgs/pkgs/development/tools/xcbuild/sdks.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
957 B
Nix
Raw Normal View History

{ runCommand, lib, toolchainName, sdkName
2023-04-16 10:38:30 +00:00
, writeText, xcodePlatform, sdkVer, productBuildVer }:
let
inherit (lib.generators) toPlist toJSON;
SDKSettings = {
CanonicalName = sdkName;
DisplayName = sdkName;
Toolchains = [ toolchainName ];
2023-04-16 10:38:30 +00:00
Version = sdkVer;
MaximumDeploymentTarget = sdkVer;
isBaseSDK = "YES";
};
2023-04-16 10:38:30 +00:00
SystemVersion = lib.optionalAttrs (productBuildVer != null) {
ProductBuildVersion = productBuildVer;
} // {
ProductName = "Mac OS X";
2023-04-16 10:38:30 +00:00
ProductVersion = sdkVer;
};
in
2018-07-11 15:45:23 +00:00
runCommand "SDKs" {} ''
sdk=$out/${sdkName}.sdk
install -D ${writeText "SDKSettings.plist" (toPlist {} SDKSettings)} $sdk/SDKSettings.plist
install -D ${writeText "SDKSettings.json" (toJSON {} SDKSettings)} $sdk/SDKSettings.json
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
ln -s $sdk $out/${xcodePlatform}.sdk
''