bscpkgs/garlic/sedReport.nix

20 lines
395 B
Nix
Raw Normal View History

{
stdenv
, fig
}:
stdenv.mkDerivation {
name = "report";
src = ./.;
buildPhase = ''
grep -o '@[^ @]*@' report.tex | sed 's/@//g' | sort -u > list
echo "fig:" > fun.nix
echo "'''" >> fun.nix
sed 's:\(^.*\)$:sed -i "s;@\1@;''${\1};g" report.tex:g' list >> fun.nix
echo "'''" >> fun.nix
'';
installPhase = ''
cp fun.nix $out
'';
}