mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 09:02:46 +00:00
6fba728a6d
Without this xcbuild can detect an incorrect version for store paths that have a sequence of digits in their hash. ld: malformed 32-bit x.y.z version number: 85294 /nix/store/yz966rdvw1blblvzs15pxpcd85294isw-MacOSX.platform/Developer/SDKs/MacOSX.sdk
36 lines
906 B
Nix
36 lines
906 B
Nix
{ stdenv, writeText, toolchainName, sdkName, xcbuild }:
|
|
|
|
let
|
|
# 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
|
|
|
|
stdenv.mkDerivation {
|
|
name = "MacOSX${version}.sdk";
|
|
inherit version;
|
|
|
|
buildInputs = [ xcbuild ];
|
|
|
|
buildCommand = ''
|
|
mkdir -p $out/
|
|
plutil -convert xml1 -o $out/SDKSettings.plist ${writeText "SDKSettings.json" (builtins.toJSON SDKSettings)}
|
|
|
|
mkdir -p $out/System/Library/CoreServices/
|
|
plutil -convert xml1 -o $out/System/Library/CoreServices/SystemVersion.plist ${writeText "SystemVersion.plist" (builtins.toJSON SystemVersion)}
|
|
'';
|
|
}
|