nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 texliveMedium,
6}:
7
8stdenv.mkDerivation rec {
9
10 pname = "nuweb";
11 version = "1.62";
12
13 src = fetchurl {
14 url = "mirror://sourceforge/project/nuweb/${pname}-${version}.tar.gz";
15 sha256 = "sha256-JVqPYkYPXBT0xLNWuW4DV6N6ZlKuBYQGT46frhnpU64=";
16 };
17
18 buildInputs = [ texliveMedium ];
19
20 patchPhase = ''
21 sed -i -e 's|nuweb -r|./nuweb -r|' Makefile
22 '';
23
24 # Workaround build failure on -fno-common toolchains like upstream
25 # gcc-10. Otherwise build fails as:
26 # ld: global.o:/build/nuweb-1.62/global.h:91: multiple definition of
27 # `current_sector'; main.o:/build/nuweb-1.62/global.h:91: first defined here
28 env.NIX_CFLAGS_COMPILE = "-fcommon";
29
30 buildPhase = ''
31 make nuweb
32 make nuweb.pdf nuwebdoc.pdf all
33 '';
34 installPhase = ''
35 install -d $out/bin $out/share/man/man1 $out/share/doc/${pname}-${version} $out/share/emacs/site-lisp
36 cp nuweb $out/bin
37 cp nuweb.el $out/share/emacs/site-lisp
38 gzip -c nuweb.1 > $out/share/man/man1/nuweb.1.gz
39 cp htdocs/index.html nuweb.w nuweb.pdf nuwebdoc.pdf README $out/share/doc/${pname}-${version}
40 '';
41
42 meta = {
43 description = "Simple literate programming tool";
44 mainProgram = "nuweb";
45 homepage = "https://nuweb.sourceforge.net";
46 license = lib.licenses.free;
47 maintainers = [ ];
48 platforms = lib.platforms.unix;
49 };
50}
51# TODO: nuweb.el Emacs integration