toybox: fix Libsystem inconsistency properly

As @wegank pointed out, the problem was that buildPackages.stdenv.cc was in
depsBuildBuild and that includes the regular stdenv's Libsystem. Only do that
when cross-compiling.
This commit is contained in:
Atemu 2023-01-16 11:20:00 +01:00
parent 2f1948af9c
commit 5e2eff6984
2 changed files with 4 additions and 7 deletions

View file

@ -1,6 +1,6 @@
{
stdenv, lib, fetchFromGitHub, which,
buildPackages, libxcrypt, libiconv, Libsystem,
buildPackages, libxcrypt, libiconv,
enableStatic ? stdenv.hostPlatform.isStatic,
enableMinimal ? false,
extraConfig ? ""
@ -17,12 +17,11 @@ stdenv.mkDerivation rec {
sha256 = "sha256-T3qE9xlcEoZOcY52XfYPpN34zzQl6mfcRnyuldnIvCk=";
};
depsBuildBuild = [ buildPackages.stdenv.cc ]; # needed for cross
depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; # needed for cross
buildInputs = [
libxcrypt
] ++lib.optionals stdenv.isDarwin [
] ++ lib.optionals stdenv.isDarwin [
libiconv
Libsystem # This shouldn't be necessary, see https://github.com/NixOS/nixpkgs/issues/210923
] ++lib.optionals (enableStatic && stdenv.cc.libc ? static) [
stdenv.cc.libc
stdenv.cc.libc.static

View file

@ -12452,9 +12452,7 @@ with pkgs;
toxvpn = callPackage ../tools/networking/toxvpn { };
toybox = darwin.apple_sdk_11_0.callPackage ../tools/misc/toybox {
inherit (darwin.apple_sdk_11_0) Libsystem;
};
toybox = darwin.apple_sdk_11_0.callPackage ../tools/misc/toybox { };
trackma = callPackage ../tools/misc/trackma { };