diff --git a/pkgs/misc/tex/nix/animatedot.sh b/pkgs/misc/tex/nix/animatedot.sh new file mode 100644 index 00000000000..da4bb00c176 --- /dev/null +++ b/pkgs/misc/tex/nix/animatedot.sh @@ -0,0 +1,9 @@ +. $stdenv/setup + +ensureDir $out + +for i in $(seq 1 $nrFrames); do + echo "producing frame $i..."; + targetName=$out/$(basename $(stripHash $dotGraph; echo $strippedName) .dot)-f-$i.dot + cpp -DFRAME=$i < $dotGraph > $targetName +done diff --git a/pkgs/misc/tex/nix/default.nix b/pkgs/misc/tex/nix/default.nix index 8509562d90c..52345d0f66b 100644 --- a/pkgs/misc/tex/nix/default.nix +++ b/pkgs/misc/tex/nix/default.nix @@ -53,5 +53,11 @@ rec { ]; }; - + + animateDot = dotGraph: nrFrames: pkgs.stdenv.mkDerivation { + name = "dot-frames"; + builder = ./animatedot.sh; + inherit dotGraph nrFrames; + }; + } \ No newline at end of file