nixpkgs-suyu/pkgs/misc/tex/nix/dot2pdf.sh
Eelco Dolstra d051b20a39 * Graphviz updated to 2.20.2. Now built with fontconfig, gd and pango
support.
* New function makeFontsConf to generate a fontconfig configuration
  file.  Moved from NixOS.
* dot2pdf: use makeFontsConf to generate a fonts.conf containing just
  the Ghostscript fonts (see NIXPKGS-29).
* dot2pdf: generate PDF directly, don't go through PS.  Note that this
  and using fontconfig changes the interpretation of "fontname"
  attributes in dot graphs.

svn path=/nixpkgs/trunk/; revision=12251
2008-07-03 14:27:19 +00:00

20 lines
418 B
Bash

source $stdenv/setup
ensureDir $out
dot2pdf() {
sourceFile=$1
targetName=$out/$(basename $(stripHash $sourceFile; echo $strippedName) .dot).pdf
echo "converting $sourceFile to $targetName..."
export FONTCONFIG_FILE=$fontsConf
dot -Tpdf $sourceFile > $targetName
}
for i in $dotGraph; do
if test -d $i; then
for j in $i/*; do dot2pdf $j; done
else
dot2pdf $i
fi
done