summary refs log tree commit diff
path: root/pkgs/development/tools/literate-programming/noweb/default.nix
blob: 4f8691c40adb267e640c631b69341cebeac84880 (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
{stdenv, fetchurl, gawk}:

stdenv.mkDerivation {
  name = "noweb-2.11b";
  src = fetchurl {
    urls = [ "http://ftp.de.debian.org/debian/pool/main/n/noweb/noweb_2.11b.orig.tar.gz"
             "ftp://www.eecs.harvard.edu/pub/nr/noweb.tgz"
          ];
    sha256 = "10hdd6mrk26kyh4bnng4ah5h1pnanhsrhqa7qwqy6dyv3rng44y9";
  };
  preBuild = ''
    mkdir -p $out/lib/noweb
    cd src
    makeFlags="BIN=$out/bin LIB=$out/lib/noweb MAN=$out/share/man TEXINPUTS=$out/share/texmf/tex/latex"
  '';
  preInstall=''mkdir -p $out/share/texmf/tex/latex'';
  postInstall= ''
    substituteInPlace $out/bin/cpif --replace "PATH=/bin:/usr/bin" ""
    for f in $out/bin/{noweb,nountangle,noroots,noroff,noindex} \
             $out/lib/noweb/{toroff,btdefn,totex,pipedoc,noidx,unmarkup,toascii,tohtml,emptydefn}; do
      substituteInPlace $f --replace "nawk" "${gawk}/bin/awk"
    done
  '';
  patches = [ ./no-FAQ.patch ];
}