Merge pull request #233815 from reckenrode/bindgenHook-fix

rustPlatform.bindgenHook: use the correct Libsystem on the 11.0 SDK
This commit is contained in:
Weijia Wang 2023-05-24 23:45:23 +03:00 committed by GitHub
commit db38340b4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,16 +50,18 @@ let
'';
};
mkStdenv = stdenv:
let
cc = stdenv.cc.override {
mkCc = cc:
if stdenv.isAarch64 then cc
else
cc.override {
bintools = stdenv.cc.bintools.override { libc = packages.Libsystem; };
libc = packages.Libsystem;
};
in
mkStdenv = stdenv:
if stdenv.isAarch64 then stdenv
else
(overrideCC stdenv cc).override {
(overrideCC stdenv (mkCc stdenv.cc)).override {
targetPlatform = stdenv.targetPlatform // {
darwinMinVersion = "10.12";
darwinSdkVersion = "11.0";
@ -104,6 +106,12 @@ let
rustPlatform = pkgs.makeRustPlatform {
inherit (pkgs.darwin.apple_sdk_11_0) stdenv;
inherit (pkgs) rustc cargo;
} // {
inherit (pkgs.callPackage ../../../build-support/rust/hooks {
inherit (pkgs.darwin.apple_sdk_11_0) stdenv;
inherit (pkgs) cargo rustc;
clang = mkCc pkgs.clang;
}) bindgenHook;
};
callPackage = newScope (lib.optionalAttrs stdenv.isDarwin (stdenvs // rec {