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
|
|
|
|
}:
|
|
|
|
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = "doc";
|
|
|
|
builder = ./run-latex.sh;
|
|
|
|
|
|
|
|
inherit rootFile generatePDF;
|
2005-06-20 15:26:07 +01:00
|
|
|
|
|
|
|
includes = import (findLaTeXIncludes {inherit rootFile;});
|
2005-06-20 14:51:48 +01:00
|
|
|
|
|
|
|
buildInputs = [ pkgs.tetex ];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-06-20 15:26:07 +01:00
|
|
|
findLaTeXIncludes =
|
|
|
|
{ rootFile
|
|
|
|
}:
|
|
|
|
|
|
|
|
derivation {
|
|
|
|
inherit (pkgs) stdenv;
|
|
|
|
|
|
|
|
name = "latex-includes";
|
|
|
|
system = pkgs.stdenv.system;
|
|
|
|
|
|
|
|
builder = (pkgs.perl ~ /bin/perl);
|
|
|
|
args = [ ./find-includes.pl ];
|
|
|
|
|
|
|
|
rootFile = toString rootFile; # !!! hacky
|
|
|
|
};
|
|
|
|
|
2005-06-20 14:51:48 +01:00
|
|
|
}
|