about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2023-01-16 14:35:34 +0100
committerGitHub <noreply@github.com>2023-01-16 14:35:34 +0100
commitf1b0fbcaa3a3f6b1db7ff3972d975e0167697f80 (patch)
tree4b557f3c61aca292d5b8da8a6bfb25216cb5adc6
parent94897428db22089d3bed71fd3e609b873ad5004b (diff)
parente583172fcb0ba144bad69ff47db18a5282c7cd86 (diff)
Merge pull request #211074 from Atemu/toybox-darwin-unbreak
toybox: fix Libsystem inconsistency properly
-rw-r--r--pkgs/tools/misc/toybox/default.nix15
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 10 insertions, 9 deletions
diff --git a/pkgs/tools/misc/toybox/default.nix b/pkgs/tools/misc/toybox/default.nix
index 212452001b8cd..508f0f4cee519 100644
--- a/pkgs/tools/misc/toybox/default.nix
+++ b/pkgs/tools/misc/toybox/default.nix
@@ -1,11 +1,15 @@
 {
   stdenv, lib, fetchFromGitHub, which,
-  buildPackages, libxcrypt, libiconv, Libsystem,
+  buildPackages, libxcrypt, libiconv,
   enableStatic ? stdenv.hostPlatform.isStatic,
   enableMinimal ? false,
   extraConfig ? ""
 }:
 
+let
+  inherit (lib) optionals;
+in
+
 stdenv.mkDerivation rec {
   pname = "toybox";
   version = "0.8.8";
@@ -17,13 +21,12 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-T3qE9xlcEoZOcY52XfYPpN34zzQl6mfcRnyuldnIvCk=";
   };
 
-  depsBuildBuild = [ buildPackages.stdenv.cc ]; # needed for cross
+  depsBuildBuild = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ];
   buildInputs = [
     libxcrypt
-  ] ++lib.optionals stdenv.isDarwin [
+  ] ++ 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) [
+  ] ++ optionals (enableStatic && stdenv.cc.libc ? static) [
     stdenv.cc.libc
     stdenv.cc.libc.static
   ];
@@ -52,7 +55,7 @@ stdenv.mkDerivation rec {
     make oldconfig
   '';
 
-  makeFlags = [ "PREFIX=$(out)/bin" ] ++ lib.optional enableStatic "LDFLAGS=--static";
+  makeFlags = [ "PREFIX=$(out)/bin" ] ++ optionals enableStatic [ "LDFLAGS=--static" ];
 
   installTargets = [ "install_flat" ];
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 37e57324b92c4..015a3b5c1daaa 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -12454,9 +12454,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 { };