From: Jürgen Spitzmüller Date: Fri, 25 Mar 2011 15:15:27 +0000 (+0000) Subject: * configure.py: add test for luatex version. X-Git-Tag: 2.0.0~416 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7382181e17415549118cf8e458b9f0cd757b59b9;p=features.git * configure.py: add test for luatex version. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38050 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/configure.py b/lib/configure.py index ec9b4ccc45..24c3832b5f 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -426,6 +426,39 @@ def checkLatex(dtl_tools): return '' +def checkLuatex(): + ''' Check if luatex is there and usable ''' + path, LUATEX = checkProg('LuaTeX', ['lualatex $$i']) + path, DVILUATEX = checkProg('LuaTeX (DVI)', ['dvilualatex $$i']) + if LUATEX != '': + # luatex binary is there + msg = "checking if LuaTeX is usable ..." + # Check if luatex is usable + writeToFile('luatest.tex', ''' +\\nonstopmode\\documentclass{minimal} +\\usepackage{fontspec} +\\begin{document} +. +\\end{document} +''') + # run lualatex on luatest.tex and check result + luatest = cmdOutput(LUATEX + ' luatest.tex') + if luatest.find('XeTeX is required to compile this document') != -1: + # fontspec/luatex too old! We do not support this version. + logger.info(msg + ' no (probably not recent enough)') + elif luatest.find('! LaTeX Error: File `fontspec.sty\' not found') != -1: + # fontspec missing + logger.info(msg + ' no (missing fontspec)') + else: + # working luatex + logger.info(msg + ' yes') + addToRC(r'\converter luatex pdf5 "%s" "latex=lualatex"' % LUATEX) + if DVILUATEX != '': + addToRC(r'\converter luatex dvi3 "%s" "latex=lualatex"' % DVILUATEX) + # remove temporary files + removeFiles(['luatest.tex', 'luatest.log']) + + def checkModule(module): ''' Check for a Python module, return the status ''' msg = 'checking for "' + module + ' module"... ' @@ -600,11 +633,7 @@ def checkConverterEntries(): checkProg('XeTeX', ['xelatex $$i'], rc_entry = [ r'\converter xetex pdf4 "%%" "latex=xelatex"' ]) - checkProg('LuaTeX', ['lualatex $$i'], - rc_entry = [ r'\converter luatex pdf5 "%%" "latex=lualatex"' ]) - - checkProg('LuaTeX (DVI)', ['dvilualatex $$i'], - rc_entry = [ r'\converter luatex dvi3 "%%" "latex=lualatex"' ]) + checkLuatex() ''' If we're running LyX in-place then tex2lyx will be found in ../src/tex2lyx. Add this directory to the PATH temporarily and