2005-06-20 14:51:48 +01:00
|
|
|
pkgs:
|
|
|
|
|
|
|
|
rec {
|
|
|
|
|
2005-06-20 15:26:07 +01:00
|
|
|
|
2005-06-20 14:51:48 +01:00
|
|
|
runLaTeX =
|
|
|
|
{ rootFile
|
|
|
|
, generatePDF ? true
|
2005-06-20 23:43:35 +01:00
|
|
|
, extraFiles ? []
|
2005-06-20 14:51:48 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = "doc";
|
2005-06-20 16:06:58 +01:00
|
|
|
|
2005-06-20 14:51:48 +01:00
|
|
|
builder = ./run-latex.sh;
|
2005-06-20 16:06:58 +01:00
|
|
|
copyIncludes = ./copy-includes.pl;
|
2005-06-20 14:51:48 +01:00
|
|
|
|
2005-06-20 23:43:35 +01:00
|
|
|
inherit rootFile generatePDF extraFiles;
|
2005-06-20 15:26:07 +01:00
|
|
|
|
|
|
|
includes = import (findLaTeXIncludes {inherit rootFile;});
|
2005-06-20 14:51:48 +01:00
|
|
|
|
2005-06-20 16:06:58 +01:00
|
|
|
buildInputs = [ pkgs.tetex pkgs.perl ];
|
2005-06-20 14:51:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-06-20 15:26:07 +01:00
|
|
|
findLaTeXIncludes =
|
|
|
|
{ rootFile
|
|
|
|
}:
|
|
|
|
|
2005-06-20 16:06:58 +01:00
|
|
|
pkgs.stdenv.mkDerivation {
|
2005-06-20 15:26:07 +01:00
|
|
|
name = "latex-includes";
|
2005-06-20 16:06:58 +01:00
|
|
|
|
|
|
|
realBuilder = pkgs.perl ~ "bin/perl";
|
2005-06-20 15:26:07 +01:00
|
|
|
args = [ ./find-includes.pl ];
|
|
|
|
|
|
|
|
rootFile = toString rootFile; # !!! hacky
|
2005-06-20 16:20:37 +01:00
|
|
|
|
|
|
|
# Forces rebuilds.
|
|
|
|
hack = __currentTime;
|
2005-06-20 16:06:58 +01:00
|
|
|
};
|
2005-06-20 23:43:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
dot2pdf =
|
|
|
|
{ dotGraph
|
|
|
|
}:
|
|
|
|
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = "pdf";
|
|
|
|
builder = ./dot2pdf.sh;
|
|
|
|
inherit dotGraph;
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.perl pkgs.tetex pkgs.graphviz pkgs.ghostscript
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2005-06-27 10:44:27 +01:00
|
|
|
|
|
|
|
animateDot = dotGraph: nrFrames: pkgs.stdenv.mkDerivation {
|
|
|
|
name = "dot-frames";
|
|
|
|
builder = ./animatedot.sh;
|
|
|
|
inherit dotGraph nrFrames;
|
|
|
|
};
|
|
|
|
|
2005-06-20 14:51:48 +01:00
|
|
|
}
|