bmake runs the ksh test if /bin/ksh exists. This is never a good
indication on platforms where we can sandbox and causes problems on
darwin where this path may exist, but never would be in PATH.
We solve this problem by always enabling the test and adding ksh to
checkInputs.
ksh doesn't seem to compile with musl, so we disable it on that
platform.
These are all read from the environment by the default bmake
stdlib (e.g. <bsd.prog.mk>, <bsd.own.mk>). Some of the default
values (like building cat pages instead of man pages, or stripping
binaries when installing) don't really make sense for Nixpkgs, so we
override them here for every build using bmake.
Eventually I'd like to unify the bmake setupHook and the NetBSD make
setupHook, but not today.
* Fix varmod-localtime test by setting TZ to an absolute path to the
appropriate file in TZDIR. This avoids having an extra patch for musl
which doesn't support TZDIR at all.
* Move tests into checkPhase by applying patch from alpine
* Fix build with musl by disabling deptgt-delete_on_error test (which I
haven't debugged myself, just copied this from alpine) and fixing a
test which fails due to differing output from strerror(3) between musl
and glibc. Also we need to add a shebang to install-sh, otherwise it
won't be executed in pkgsMusl.
With this change,
nativeBuildInputs = [ bmake ];
will cause bmake to be used instead of GNU make, but with the usual
stdenv API. Packages using bmake will no longer need to implement
their own {build,check,dist}Phase.