1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-13 08:05:40 +00:00
nixpkgs/pkgs/development/tools/xcbuild/sdks.nix

30 lines
750 B
Nix
Raw Normal View History

{ runCommand, lib, toolchainName, sdkName
, writeText, version, xcodePlatform }:
let
inherit (lib.generators) toPlist;
SDKSettings = {
CanonicalName = sdkName;
DisplayName = sdkName;
Toolchains = [ toolchainName ];
Version = version;
MaximumDeploymentTarget = version;
isBaseSDK = "YES";
};
SystemVersion = {
ProductName = "Mac OS X";
ProductVersion = version;
};
in
2018-07-11 16:45:23 +01:00
runCommand "SDKs" {} ''
sdk=$out/${sdkName}.sdk
install -D ${writeText "SDKSettings.plist" (toPlist {} SDKSettings)} $sdk/SDKSettings.plist
install -D ${writeText "SystemVersion.plist" (toPlist {} SystemVersion)} $sdk/System/Library/CoreServices/SystemVersion.plist
2018-07-11 16:45:23 +01:00
ln -s $sdk $sdk/usr
ln -s $sdk $out/${xcodePlatform}.sdk
''