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

toybox: fix Libsystem inconsistency properly
This commit is contained in:
Jörg Thalheim 2023-01-16 14:35:34 +01:00 committed by GitHub
commit f1b0fbcaa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View file

@ -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" ];

View file

@ -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 { };