lol
1{ stdenv, fetchurl, yacc }:
2
3stdenv.mkDerivation rec {
4 name = "nawk-20121220";
5
6 src = fetchurl {
7 url = "https://www.cs.princeton.edu/~bwk/btl.mirror/awk.tar.gz";
8 sha256 = "10wvdn7xwc5bbp5h7l0b9fxby3bds21n8a34z54i8kjsbhb95h4d";
9 };
10
11 nativeBuildInputs = [ yacc ];
12
13 unpackPhase = ''
14 mkdir build
15 cd build
16 tar xvf ${src}
17 '';
18
19 patchPhase = ''
20 substituteInPlace ./makefile \
21 --replace "YACC = yacc -d -S" ""
22 '';
23
24 installPhase = ''
25 install -Dm755 a.out "$out/bin/nawk"
26 install -Dm644 awk.1 "$out/share/man/man1/nawk.1"
27 '';
28
29 meta = {
30 description = "The one, true implementation of AWK";
31 longDescription = ''
32 This is the version of awk described in "The AWK Programming
33 Language", by Al Aho, Brian Kernighan, and Peter Weinberger
34 (Addison-Wesley, 1988, ISBN 0-201-07981-X).
35 '';
36 homepage = https://www.cs.princeton.edu/~bwk/btl.mirror/;
37 license = stdenv.lib.licenses.mit;
38 maintainers = [ stdenv.lib.maintainers.konimex ];
39 platforms = stdenv.lib.platforms.all;
40 };
41}