dot2ps
svn path=/nixpkgs/trunk/; revision=5152
commit00bdbb7fffa3162d8eb1cbd4db5f2da311f9c0c7
authorEelco Visser <visser@acm.org>
dateTue 11 Apr 2006, 13:27 (21 years ago)
parent57c5067
pkgs/misc/tex/nix/default.nix+15−1
@@ -56,10 +56,24 @@ rec {
5656 };
5757
5858
59+ dot2ps =
60+ { dotGraph
61+ }:
62+
63+ pkgs.stdenv.mkDerivation {
64+ name = "ps";
65+ builder = ./dot2ps.sh;
66+ inherit dotGraph;
67+ buildInputs = [
68+ pkgs.perl pkgs.tetex pkgs.graphviz pkgs.ghostscript
69+ ];
70+ };
71+
72+
5973 animateDot = dotGraph: nrFrames: pkgs.stdenv.mkDerivation {
6074 name = "dot-frames";
6175 builder = ./animatedot.sh;
6276 inherit dotGraph nrFrames;
6377 };
6478
65−}
79+}
pkgs/misc/tex/nix/dot2ps.shnew file+19
@@ -0,0 +1,19 @@
1+source $stdenv/setup
2+
3+ensureDir $out
4+
5+dot2ps() {
6+ sourceFile=$1
7+ targetName=$out/$(basename $(stripHash $sourceFile; echo $strippedName) .dot).ps
8+ echo "converting $sourceFile to $targetName..."
9+ dot -Tps $sourceFile > $targetName
10+}
11+
12+for i in $dotGraph; do
13+ if test -d $i; then
14+ for j in $i/*; do dot2ps $j; done
15+ else
16+ dot2ps $i
17+ fi
18+done
19+