2024-09-25 01:43:34 +00:00
|
|
|
# This is a compatibility shim with `overrideSDK`.
|
|
|
|
# Note: `overrideSDK` is deprecated. It will be added to `aliases.nix` after in-tree usage has been cleaned up.
|
2024-02-03 18:18:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenvNoCC,
|
|
|
|
extendMkDerivationArgs,
|
|
|
|
pkgsHostTarget,
|
2024-09-25 01:43:34 +00:00
|
|
|
}:
|
2024-02-03 18:18:59 +00:00
|
|
|
|
2024-09-25 01:43:34 +00:00
|
|
|
stdenv: sdkVersion:
|
2024-02-03 18:18:59 +00:00
|
|
|
let
|
2024-09-25 01:43:34 +00:00
|
|
|
newVersion = {
|
|
|
|
inherit (stdenv.hostPlatform) darwinMinVersion darwinSdkVersion;
|
|
|
|
} // (if lib.isAttrs sdkVersion then sdkVersion else { darwinSdkVersion = sdkVersion; });
|
2024-02-03 18:18:59 +00:00
|
|
|
|
2024-09-25 01:43:34 +00:00
|
|
|
inherit (newVersion) darwinMinVersion darwinSdkVersion;
|
2024-02-03 18:18:59 +00:00
|
|
|
|
2024-09-25 01:43:34 +00:00
|
|
|
sdkMapping = {
|
|
|
|
"11.0" = pkgsHostTarget.apple-sdk_11;
|
|
|
|
"12.3" = pkgsHostTarget.apple-sdk_12;
|
|
|
|
};
|
2024-02-03 18:18:59 +00:00
|
|
|
|
2024-09-25 01:43:34 +00:00
|
|
|
minVersionHook = pkgsHostTarget.darwinMinVersionHook darwinMinVersion;
|
2024-02-03 18:18:59 +00:00
|
|
|
|
2024-09-25 01:43:34 +00:00
|
|
|
resolvedSdk =
|
|
|
|
sdkMapping.${darwinSdkVersion} or (lib.throw ''
|
|
|
|
`overrideSDK` and `darwin.apple_sdk_11_0.callPackage` are deprecated.
|
|
|
|
Only the 11.0 and 12.3 SDKs are supported using them. Please use
|
|
|
|
the versioned `apple-sdk` variants to use other SDK versions.
|
2024-02-03 18:18:59 +00:00
|
|
|
|
2024-09-25 01:43:34 +00:00
|
|
|
See the stdenv documentation for how to use `apple-sdk`.
|
|
|
|
'');
|
2024-02-03 18:18:59 +00:00
|
|
|
in
|
2024-09-25 01:43:34 +00:00
|
|
|
stdenv.override (old: {
|
|
|
|
mkDerivationFromStdenv = extendMkDerivationArgs old (args: {
|
|
|
|
buildInputs =
|
|
|
|
args.buildInputs or [ ]
|
|
|
|
++ lib.optional (stdenv.hostPlatform.darwinMinVersion != darwinMinVersion) minVersionHook
|
|
|
|
++ lib.optional (stdenv.hostPlatform.darwinSdkVersion != darwinSdkVersion) resolvedSdk;
|
|
|
|
});
|
|
|
|
})
|