Skip to content

Commit

Permalink
Merge pull request #233815 from reckenrode/bindgenHook-fix
Browse files Browse the repository at this point in the history
rustPlatform.bindgenHook: use the correct Libsystem on the 11.0 SDK
  • Loading branch information
wegank authored May 24, 2023
2 parents 7ef1dda + 3d29de1 commit db38340
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions pkgs/os-specific/darwin/apple-sdk-11.0/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit db38340

Please sign in to comment.