From 2cc66184ce47ba85de1eb0dd495b6baf0442d986 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 20 Jun 2005 14:26:07 +0000 Subject: [PATCH] * Oops. svn path=/nixpkgs/trunk/; revision=3218 --- pkgs/misc/tex/nix/default.nix | 19 +++++++++++++++++++ pkgs/misc/tex/nix/run-latex.sh | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/tex/nix/default.nix b/pkgs/misc/tex/nix/default.nix index eca48ca25bf..09e2a87fce9 100644 --- a/pkgs/misc/tex/nix/default.nix +++ b/pkgs/misc/tex/nix/default.nix @@ -2,6 +2,7 @@ pkgs: rec { + runLaTeX = { rootFile , generatePDF ? true @@ -12,9 +13,27 @@ rec { builder = ./run-latex.sh; inherit rootFile generatePDF; + + includes = import (findLaTeXIncludes {inherit rootFile;}); buildInputs = [ pkgs.tetex ]; }; + 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 + }; + } \ No newline at end of file diff --git a/pkgs/misc/tex/nix/run-latex.sh b/pkgs/misc/tex/nix/run-latex.sh index afc0608e724..be99eaffe25 100644 --- a/pkgs/misc/tex/nix/run-latex.sh +++ b/pkgs/misc/tex/nix/run-latex.sh @@ -2,7 +2,7 @@ ensureDir $out -for i in $rootFile $sources; do +for i in $includes; do if test -d $i; then cp $i/* . else