9 enableStatic ? stdenv.hostPlatform.isStatic,
10 enableMinimal ? false,
15 inherit (lib) optionals;
18 stdenv.mkDerivation rec {
22 src = fetchFromGitHub {
26 sha256 = "sha256-7izs2C5/czec0Dt3apL8s7luARAlw4PfUFy9Xsxb0zw=";
29 depsBuildBuild = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
30 buildPackages.stdenv.cc
36 ++ optionals stdenv.hostPlatform.isDarwin [
39 ++ optionals (enableStatic && stdenv.cc.libc ? static) [
44 postPatch = "patchShebangs .";
47 passAsFile = [ "extraConfig" ];
53 else if stdenv.hostPlatform.isFreeBSD then
55 else if stdenv.hostPlatform.isDarwin then
61 cat $extraConfigPath .config > .config-
67 makeFlags = [ "PREFIX=$(out)/bin" ] ++ optionals enableStatic [ "LDFLAGS=--static" ];
69 installTargets = [ "install_flat" ];
71 # tests currently (as of 0.8.0) get stuck in an infinite loop...
72 # ...this is fixed in latest git, so doCheck can likely be enabled for next release
73 # see https://github.com/landley/toybox/commit/b928ec480cd73fd83511c0f5ca786d1b9f3167c3
75 nativeCheckInputs = [ which ]; # used for tests with checkFlags = [ "DEBUG=true" ];
76 checkTarget = "tests";
78 env.NIX_CFLAGS_COMPILE = "-Wno-error";
81 description = "Lightweight implementation of some Unix command line utilities";
82 homepage = "https://landley.net/toybox/";
83 license = licenses.bsd0;
84 platforms = with platforms; linux ++ darwin ++ freebsd;
85 maintainers = with maintainers; [ hhm ];