Merge pull request #211074 from Atemu/toybox-darwin-unbreak

toybox: fix Libsystem inconsistency properly

authored by Jörg Thalheim and committed by GitHub f1b0fbca 94897428

+10 -9
+9 -6
pkgs/tools/misc/toybox/default.nix
··· 1 1 { 2 2 stdenv, lib, fetchFromGitHub, which, 3 - buildPackages, libxcrypt, libiconv, Libsystem, 3 + buildPackages, libxcrypt, libiconv, 4 4 enableStatic ? stdenv.hostPlatform.isStatic, 5 5 enableMinimal ? false, 6 6 extraConfig ? "" 7 7 }: 8 + 9 + let 10 + inherit (lib) optionals; 11 + in 8 12 9 13 stdenv.mkDerivation rec { 10 14 pname = "toybox"; ··· 17 21 sha256 = "sha256-T3qE9xlcEoZOcY52XfYPpN34zzQl6mfcRnyuldnIvCk="; 18 22 }; 19 23 20 - depsBuildBuild = [ buildPackages.stdenv.cc ]; # needed for cross 24 + depsBuildBuild = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; 21 25 buildInputs = [ 22 26 libxcrypt 23 - ] ++lib.optionals stdenv.isDarwin [ 27 + ] ++ optionals stdenv.isDarwin [ 24 28 libiconv 25 - Libsystem # This shouldn't be necessary, see https://github.com/NixOS/nixpkgs/issues/210923 26 - ] ++lib.optionals (enableStatic && stdenv.cc.libc ? static) [ 29 + ] ++ optionals (enableStatic && stdenv.cc.libc ? static) [ 27 30 stdenv.cc.libc 28 31 stdenv.cc.libc.static 29 32 ]; ··· 52 55 make oldconfig 53 56 ''; 54 57 55 - makeFlags = [ "PREFIX=$(out)/bin" ] ++ lib.optional enableStatic "LDFLAGS=--static"; 58 + makeFlags = [ "PREFIX=$(out)/bin" ] ++ optionals enableStatic [ "LDFLAGS=--static" ]; 56 59 57 60 installTargets = [ "install_flat" ]; 58 61
+1 -3
pkgs/top-level/all-packages.nix
··· 12454 12454 12455 12455 toxvpn = callPackage ../tools/networking/toxvpn { }; 12456 12456 12457 - toybox = darwin.apple_sdk_11_0.callPackage ../tools/misc/toybox { 12458 - inherit (darwin.apple_sdk_11_0) Libsystem; 12459 - }; 12457 + toybox = darwin.apple_sdk_11_0.callPackage ../tools/misc/toybox { }; 12460 12458 12461 12459 trackma = callPackage ../tools/misc/trackma { }; 12462 12460