From 5e2eff698439e5f28961ca29683ba1a8de0af8be Mon Sep 17 00:00:00 2001 From: Atemu Date: Mon, 16 Jan 2023 11:20:00 +0100 Subject: [PATCH] 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. --- pkgs/tools/misc/toybox/default.nix | 7 +++---- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/misc/toybox/default.nix b/pkgs/tools/misc/toybox/default.nix index 212452001b8c..800cdbad0972 100644 --- a/pkgs/tools/misc/toybox/default.nix +++ b/pkgs/tools/misc/toybox/default.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 98a181e7d1e0..8c14b1b1396e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };