lol
1{ stdenv, fetchurl, groff, less }:
2
3stdenv.mkDerivation rec {
4 name = "man-1.6g";
5
6 src = fetchurl {
7 url = "http://primates.ximian.com/~flucifredi/man/${name}.tar.gz";
8 sha256 = "17wmp2ahkhl72cvfzshmck22dnq2lbjg0678swihj270yk1vip6c";
9 };
10
11 buildInputs = [ groff less ];
12
13 preBuild = ''
14 makeFlagsArray=(bindir=$out/bin sbindir=$out/sbin libdir=$out/lib mandir=$out/share/man)
15 '';
16
17 patches = [
18 # Search in "share/man" relative to each path in $PATH (in addition to "man").
19 ./share.patch
20
21 # Prefer /etc/man.conf over $out/lib/man.conf. Man only reads the
22 # first file that exists, so this is necessary to allow the
23 # builtin config to be overriden.
24 ./conf.patch
25 ];
26
27 preConfigure = ''
28 sed 's/^PREPATH=.*/PREPATH=$PATH/' -i configure
29 '';
30
31 postInstall =
32 ''
33 # Use UTF-8 by default. Otherwise man won't know how to deal
34 # with certain characters.
35 substituteInPlace $out/lib/man.conf \
36 --replace "nroff -Tlatin1" "nroff" \
37 --replace "eqn -Tlatin1" "eqn -Tutf8"
38
39 # Work around a bug in substituteInPlace. It loses the final
40 # newline, and man requires every line in man.conf to be
41 # terminated by a newline.
42 echo >> $out/lib/man.conf
43 '';
44
45 meta = {
46 homepage = http://primates.ximian.com/~flucifredi/man/;
47 description = "Tool to read online Unix documentation";
48 platforms = stdenv.lib.platforms.unix;
49 };
50}