From f273e7629e5b1ce047418359a61efe90fae88b81 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 27 May 2013 09:36:13 +0200 Subject: gajim: Add support for LaTeX markup. This needed a bit of patching the paths to the latex and dvipng executables. In addition, we also address a small bug by using sed: tmpfd, tmppng = mkstemp(prefix='gajim_tex', suffix='.png') tmpfd.close() This obviously won't work, because mkstemp() actually returns a file descriptor _number_ and not a Python file object. Signed-off-by: aszlig --- .../networking/instant-messengers/gajim/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'pkgs/applications/networking/instant-messengers/gajim') diff --git a/pkgs/applications/networking/instant-messengers/gajim/default.nix b/pkgs/applications/networking/instant-messengers/gajim/default.nix index c8c3f3b7d2a0..3c3cc5ccdfce 100644 --- a/pkgs/applications/networking/instant-messengers/gajim/default.nix +++ b/pkgs/applications/networking/instant-messengers/gajim/default.nix @@ -6,6 +6,7 @@ , enableE2E ? true , enableRST ? true , enableSpelling ? true, gtkspell ? null +, enableLaTeX ? false, texLive ? null }: assert enableJingle -> farstream != null && gst_plugins_bad != null @@ -13,6 +14,7 @@ assert enableJingle -> farstream != null && gst_plugins_bad != null assert enableE2E -> pythonPackages.pycrypto != null; assert enableRST -> pythonPackages.docutils != null; assert enableSpelling -> gtkspell != null; +assert enableLaTeX -> texLive != null; with stdenv.lib; @@ -53,6 +55,11 @@ stdenv.mkDerivation rec { '' + optionalString enableSpelling '' sed -i -e 's|=.*find_lib.*|= "${gtkspell}/lib/libgtkspell.so"|' \ src/gtkspell.py + '' + optionalString enableLaTeX '' + sed -i -e "s|try_run(.'dvipng'|try_run(['${texLive}/bin/dvipng'|" \ + -e "s|try_run(.'latex'|try_run(['${texLive}/bin/latex'|" \ + -e 's/tmpfd.close()/os.close(tmpfd)/' \ + src/common/latex.py ''; buildInputs = [ @@ -63,7 +70,8 @@ stdenv.mkDerivation rec { pyopenssl pythonDBus ] ++ optionals enableJingle [ farstream gst_plugins_bad libnice ] ++ optional enableE2E pythonPackages.pycrypto - ++ optional enableRST pythonPackages.docutils; + ++ optional enableRST pythonPackages.docutils + ++ optional enableLaTeX texLive; postInstall = '' install -m 644 -t "$out/share/gajim/icons/hicolor" \ -- cgit 1.4.1