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

30 lines
767 B
Nix
Raw Normal View History

{ runCommand, lib, toolchainName, sdkName, writeText }:
let
inherit (lib.generators) toPLIST;
# TODO: expose MACOSX_DEPLOYMENT_TARGET in nix so we can use it here.
version = "10.10";
SDKSettings = {
CanonicalName = sdkName;
DisplayName = sdkName;
Toolchains = [ toolchainName ];
Version = version;
MaximumDeploymentTarget = version;
isBaseSDK = "YES";
};
SystemVersion = {
ProductName = "Mac OS X";
ProductVersion = version;
};
in
runCommand "MacOSX${version}.sdk" {
inherit version;
} ''
2018-06-28 15:11:19 +00:00
install -D ${writeText "SDKSettings.plist" (toPLIST {} SDKSettings)} $out/SDKSettings.plist
install -D ${writeText "SystemVersion.plist" (toPLIST {} SystemVersion)} $out/System/Library/CoreServices/SystemVersion.plist
''