diff options
author | Malo Bourgon <mbourgon@gmail.com> | 2023-03-04 10:34:01 +1100 |
---|---|---|
committer | Malo Bourgon <mbourgon@gmail.com> | 2023-03-04 12:34:48 +1100 |
commit | 68648fa4c01e5b9f9b91cf0235652bbaec154926 (patch) | |
tree | 3314c6a9dbca95662b834f1bf2c8527e288aa3a2 /pkgs/os-specific | |
parent | ea0dc57bb6d17b2e83929d5d8378281174a9a2a7 (diff) |
darwin.apple_sdk_11_0.clang{12-15}Stdenv: init
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/darwin/apple-sdk-11.0/default.nix | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix index 145c98496b49a..df707e2b6e267 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/default.nix @@ -56,9 +56,32 @@ let ''; }; + mkStdenv = stdenv: + let + cc = stdenv.cc.override { + bintools = stdenv.cc.bintools.override { libc = packages.Libsystem; }; + libc = packages.Libsystem; + }; + in + if stdenv.isAarch64 then stdenv + else + (overrideCC stdenv cc).override { + targetPlatform = stdenv.targetPlatform // { + darwinMinVersion = "10.12"; + darwinSdkVersion = "11.0"; + }; + }; + + stdenvs = { + stdenv = mkStdenv stdenv; + } // builtins.listToAttrs (map + (v: { name = "clang${v}Stdenv"; value = mkStdenv pkgs."llvmPackages_${v}".stdenv; }) + [ "12" "13" "14" "15" ] + ); + callPackage = newScope (packages // pkgs.darwin // { inherit MacOSX-SDK; }); - packages = { + packages = stdenvs // { inherit (callPackage ./apple_sdk.nix {}) frameworks libs; # TODO: this is nice to be private. is it worth the callPackage above? @@ -89,30 +112,14 @@ let inherit (pkgs) rustc cargo; }; - callPackage = newScope (lib.optionalAttrs stdenv.isDarwin rec { - inherit (pkgs.darwin.apple_sdk_11_0) stdenv xcodebuild rustPlatform; + callPackage = newScope (lib.optionalAttrs stdenv.isDarwin (stdenvs // rec { + inherit (pkgs.darwin.apple_sdk_11_0) xcodebuild rustPlatform; darwin = pkgs.darwin.overrideScope (_: prev: { inherit (prev.darwin.apple_sdk_11_0) Libsystem LibsystemCross libcharset libunwind objc4 configd IOKit Security; apple_sdk = prev.darwin.apple_sdk_11_0; CF = prev.darwin.apple_sdk_11_0.CoreFoundation; }); xcbuild = xcodebuild; - }); - - stdenv = - let - clang = stdenv.cc.override { - bintools = stdenv.cc.bintools.override { libc = packages.Libsystem; }; - libc = packages.Libsystem; - }; - in - if stdenv.isAarch64 then stdenv - else - (overrideCC stdenv clang).override { - targetPlatform = stdenv.targetPlatform // { - darwinMinVersion = "10.12"; - darwinSdkVersion = "11.0"; - }; - }; + })); }; in packages |