Skip to content

Commit

Permalink
darwin.apple_sdk_11_0: add mkCc
Browse files Browse the repository at this point in the history
  • Loading branch information
wegank committed May 24, 2023
1 parent 2c07076 commit 3d29de1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 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 @@ -108,10 +110,7 @@ let
inherit (pkgs.callPackage ../../../build-support/rust/hooks {
inherit (pkgs.darwin.apple_sdk_11_0) stdenv;
inherit (pkgs) cargo rustc;
clang = pkgs.clang.override {
bintools = pkgs.clang.bintools.override { libc = packages.Libsystem; };
libc = packages.Libsystem;
};
clang = mkCc pkgs.clang;
}) bindgenHook;
};

Expand Down

0 comments on commit 3d29de1

Please sign in to comment.