darwin.apple_sdk_11_0: add mkCc

This commit is contained in:
Weijia Wang 2023-05-24 16:49:40 +03:00
parent 2c070763c7
commit 3d29de1f5b

View file

@ -50,16 +50,18 @@ let
''; '';
}; };
mkStdenv = stdenv: mkCc = cc:
let if stdenv.isAarch64 then cc
cc = stdenv.cc.override { else
cc.override {
bintools = stdenv.cc.bintools.override { libc = packages.Libsystem; }; bintools = stdenv.cc.bintools.override { libc = packages.Libsystem; };
libc = packages.Libsystem; libc = packages.Libsystem;
}; };
in
mkStdenv = stdenv:
if stdenv.isAarch64 then stdenv if stdenv.isAarch64 then stdenv
else else
(overrideCC stdenv cc).override { (overrideCC stdenv (mkCc stdenv.cc)).override {
targetPlatform = stdenv.targetPlatform // { targetPlatform = stdenv.targetPlatform // {
darwinMinVersion = "10.12"; darwinMinVersion = "10.12";
darwinSdkVersion = "11.0"; darwinSdkVersion = "11.0";
@ -108,10 +110,7 @@ let
inherit (pkgs.callPackage ../../../build-support/rust/hooks { inherit (pkgs.callPackage ../../../build-support/rust/hooks {
inherit (pkgs.darwin.apple_sdk_11_0) stdenv; inherit (pkgs.darwin.apple_sdk_11_0) stdenv;
inherit (pkgs) cargo rustc; inherit (pkgs) cargo rustc;
clang = pkgs.clang.override { clang = mkCc pkgs.clang;
bintools = pkgs.clang.bintools.override { libc = packages.Libsystem; };
libc = packages.Libsystem;
};
}) bindgenHook; }) bindgenHook;
}; };