forked from mirrors/nixpkgs
c672e37f4a
This is a good way to test that plist works. Sorry for the large diff. There are a bunch of cleanups in here that needed to be done. Should make it possible to use in cross compilation.
30 lines
761 B
Nix
30 lines
761 B
Nix
{ 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;
|
|
} ''
|
|
install -D ${writeText "SDKSettings.plist" (toPLIST SDKSettings)} $out/SDKSettings.plist
|
|
install -D ${writeText "SystemVersion.plist" (toPLIST SystemVersion)} $out/System/Library/CoreServices/SystemVersion.plist
|
|
''
|