@@ -0,0 +1,37 @@
1+{ stdenv, fetchurl
2+, gnugrep, coreutils, getopt
3+}:
4+
5+stdenv.mkDerivation rec {
6+ name = "bmake-${version}";
7+ version = "20121212";
8+
9+ src = fetchurl {
10+ # really wish this URL was versioned. if this changes for some
11+ # update in the future, we'll have to backport those updates to
12+ # any stable branches so builds can continue to work. :(
13+ url = "http://www.crufty.net/ftp/pub/sjg/bmake.tar.gz";
14+ sha256 = "0zp6yy27z52qb12bgm3hy1dwal2i570615pqqk71zwhcxfs4h2gw";
15+ };
16+
17+ nativeBuildInputs =
18+ [ gnugrep coreutils getopt
19+ ];
20+
21+ # unexport-env sets PATH to a bogus value that won't be
22+ # possible to use inside the build sandbox. nuke that test;
23+ # we could also re-construct the PATH variable a bit based on
24+ # nativeBuildInputs, but not for now
25+ patchPhase = ''
26+ substituteInPlace ./unit-tests/Makefile.in \
27+ --replace "unexport-env" ""
28+ '';
29+
30+ meta = with stdenv.lib; {
31+ description = "Portable version of NetBSD 'make'";
32+ homepage = "http://www.crufty.net/help/sjg/bmake.html";
33+ license = licenses.bsd3;
34+ platforms = platforms.unix;
35+ maintainers = with maintainers; [ thoughtpolice ];
36+ };
37+}