summary refs log tree commit diff
path: root/pkgs/tools/misc/man/default.nix
blob: b718e3c128952183931221963ee1dd9a5edd1ae3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{stdenv, fetchurl, groff, less}:
 
stdenv.mkDerivation {
  name = "man-1.6f";
  
  src = fetchurl {
    url = http://primates.ximian.com/~flucifredi/man/man-1.6f.tar.gz;
    sha256 = "0v2z6ywhy8kd2fa3ywkqayhjdivbaqn6qvhx93a1ldw135z8q84z";
  };
  
  buildInputs = [groff less];

  preBuild = ''
    makeFlagsArray=(bindir=$out/bin sbindir=$out/sbin libdir=$out/lib mandir=$out/share/man)
  '';

  patches = [
    # Search in "share/man" relative to each path in $PATH (in addition to "man").
    ./share.patch
  ];

  postInstall =
    ''
      # Use UTF-8 by default.  Otherwise man won't know how to deal
      # with certain characters.
      substituteInPlace $out/lib/man.conf \
        --replace "nroff -Tlatin1" "nroff" \
        --replace "eqn -Tlatin1" "eqn -Tutf8"
    '';

  meta = {
    homepage = http://primates.ximian.com/~flucifredi/man/;
    description = "Tool to read online Unix documentation";
  };
}