From 6b77688298fb02ac5109427011f8be724ae60ae9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 13 Apr 2016 14:32:24 +0200 Subject: fancier wrappers for converters --- ymir.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ymir.nix') diff --git a/ymir.nix b/ymir.nix index 2b250bd6..1482d4cd 100644 --- a/ymir.nix +++ b/ymir.nix @@ -65,9 +65,14 @@ in rec { pkgs.python3 pkgs.makeWrapper ]; - postInstall = '' - wrapProgram $out/lib/cgit/filters/syntax-highlighting.py --prefix PYTHONPATH ':' ${pkgs.python3.buildEnv.override { extraLibs = with pkgs.python3Packages; [ pygments ]; }}/lib/*/site-packages - wrapProgram $out/lib/cgit/filters/html-converters/md2html --prefix PYTHONPATH ':' ${pkgs.python3.buildEnv.override { extraLibs = with pkgs.python3Packages; [ markdown ]; }}/lib/*/site-packages + postInstall = let + pythonEnv = pkgs.python3.buildEnv.override { extraLibs = with pkgs.python3Packages; [ pygments markdown ]; }; + in '' + wrapProgram $out/lib/cgit/filters/syntax-highlighting.py --prefix PYTHONPATH ':' ${pythonEnv}/lib/*/site-packages + tmpFile=$(mktemp) + { echo "#!${pythonEnv}/bin/python3"; tail -n +2 $out/lib/cgit/filters/html-converters/md2html } > $tmpFile + mv -v $tmpFile $out/lib/cgit/filters/html-converters/md2html + wrapProgram $out/lib/cgit/filters/html-converters/md2html --prefix PYTHONPATH ':' ${pythonEnv}/lib/*/site-packages wrapProgram $out/lib/cgit/filters/html-converters/man2html --prefix PATH ':' ${pkgs.groff}/bin ''; }); -- cgit v1.2.3