summary refs log blame commit diff
path: root/pkgs/misc/tex/nix/default.nix
blob: 8509562d90c39b88f68f45b4f4a68f310756b88b (plain) (tree)
1
2
3
4
5
6
7
8
9



     
 


                        
                     



                              
      
                               
                                        
      
                                              

                                                                
      
                                             


      



                     
                              
                              

                                           


                                               


                           
      















                                                           
 
pkgs:

rec {


  runLaTeX =
    { rootFile
    , generatePDF ? true
    , extraFiles ? []
    }:
    
    pkgs.stdenv.mkDerivation {
      name = "doc";
      
      builder = ./run-latex.sh;
      copyIncludes = ./copy-includes.pl;
      
      inherit rootFile generatePDF extraFiles;

      includes = import (findLaTeXIncludes {inherit rootFile;});
      
      buildInputs = [ pkgs.tetex pkgs.perl ];
    };

    
  findLaTeXIncludes =
    { rootFile
    }:

    pkgs.stdenv.mkDerivation {
      name = "latex-includes";

      realBuilder = pkgs.perl ~ "bin/perl";
      args = [ ./find-includes.pl ];

      rootFile = toString rootFile; # !!! hacky

      # Forces rebuilds.
      hack = __currentTime;
    };


  dot2pdf =
    { dotGraph
    }:

    pkgs.stdenv.mkDerivation {
      name = "pdf";
      builder = ./dot2pdf.sh;
      inherit dotGraph;
      buildInputs = [
        pkgs.perl pkgs.tetex pkgs.graphviz pkgs.ghostscript
      ];
    };
  
       
}