]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.py
Fix compilation of the template ACM-sigplan.lyx
[lyx.git] / lib / configure.py
index f0b7166d26946dedab4dd955650fd4ff9a2f9de4..0b06cdecc2f81cebc19ae6664cd0e13990430dfa 100644 (file)
@@ -582,7 +582,7 @@ def checkFormatEntries(dtl_tools):
         rc_entry = [r'\Format fen        fen     FEN                    "" "%%"        "%%"    ""      ""'])
     #
     checkViewerEditor('a SVG viewer and editor', ['inkscape'],
-        rc_entry = [r'\Format svg        svg     SVG                    "" "%%" "%%"   "vector"        "image/svg+xml"'])
+        rc_entry = [r'\Format svg        "svg, svgz" SVG                "" "%%" "%%"   "vector,zipped=native"  "image/svg+xml"'])
     #
     imageformats = r'''\Format bmp        bmp     BMP                    "" "%s"       "%s"    ""      "image/x-bmp"
 \Format gif        gif     GIF                    "" "%s"      "%s"    ""      "image/gif"
@@ -646,22 +646,23 @@ def checkFormatEntries(dtl_tools):
     #
     #checkProg('a Postscript interpreter', ['gs'],
     #  rc_entry = [ r'\ps_command "%%"' ])
-    checkViewer('a Postscript previewer', ['kghostview', 'okular', 'evince', 'gv', 'ghostview -swap'],
+    checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview --unique', 'evince', 'gv', 'ghostview -swap', 'gsview64', 'gsview32'],
         rc_entry = [r'''\Format eps        eps     EPS                    "" "%%"      ""      "vector"        "image/x-eps"
 \Format eps2       eps    "EPS (uncropped)"       "" "%%"      ""      "vector"        ""
-\Format eps3       eps    "EPS (cropped)"         "" "%%"      ""      "document,menu=export"  ""
+\Format eps3       eps    "EPS (cropped)"         "" "%%"      ""      "document"      ""
 \Format ps         ps      Postscript             t  "%%"      ""      "document,vector,menu=export"   "application/postscript"'''])
     # for xdg-open issues look here: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151818.html
     # the MIME type is set for pdf6, because that one needs to be autodetectable by libmime
-    checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'evince', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf', \
-                   'gv', 'ghostview'],
+    checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview --unique', 'evince', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 'mupdf', \
+                   'gv', 'ghostview', 'AcroRd32', 'gsview64', 'gsview32'],
         rc_entry = [r'''\Format pdf        pdf    "PDF (ps2pdf)"          P  "%%"      ""      "document,vector,menu=export"   ""
 \Format pdf2       pdf    "PDF (pdflatex)"        F  "%%"      ""      "document,vector,menu=export"   ""
 \Format pdf3       pdf    "PDF (dvipdfm)"         m  "%%"      ""      "document,vector,menu=export"   ""
 \Format pdf4       pdf    "PDF (XeTeX)"           X  "%%"      ""      "document,vector,menu=export"   ""
 \Format pdf5       pdf    "PDF (LuaTeX)"          u  "%%"      ""      "document,vector,menu=export"   ""
 \Format pdf6       pdf    "PDF (graphics)"        "" "%%"      ""      "vector"        "application/pdf"
-\Format pdf7       pdf    "PDF (cropped)"         "" "%%"      ""      "document,menu=export"  ""'''])
+\Format pdf7       pdf    "PDF (cropped)"         "" "%%"      ""      "document,vector"       ""
+\Format pdf8       pdf    "PDF (lower resolution)"         "" "%%"     ""      "document,vector"       ""'''])
     #
     checkViewer('a DVI previewer', ['xdvi', 'kdvi', 'okular', 'yap', 'dviout -Set=!m'],
         rc_entry = [r'''\Format dvi        dvi     DVI                    D  "%%"      ""      "document,vector,menu=export"   "application/x-dvi"
@@ -727,15 +728,17 @@ def checkConverterEntries():
     #       will also have this version suffix.
     #   4)  Otherwise always use tex2lyx.
     in_binary_subdir = os.path.join(lyx_binary_dir, 'tex2lyx', 'tex2lyx')
-    in_binary_subdir = os.path.abspath(in_binary_subdir)
+    in_binary_subdir = os.path.abspath(in_binary_subdir).replace('\\', '/')
 
     in_binary_dir = os.path.join(lyx_binary_dir, 'tex2lyx')
-    in_binary_dir = os.path.abspath(in_binary_dir)
+    in_binary_dir = os.path.abspath(in_binary_dir).replace('\\', '/')
 
     path, t2l = checkProg('a LaTeX/Noweb -> LyX converter', [in_binary_subdir, in_binary_subdir + version_suffix, in_binary_dir, in_binary_dir + version_suffix, 'tex2lyx' + version_suffix, 'tex2lyx'],
         rc_entry = [r'''\converter latex      lyx        "%% -f $$i $$o"       ""
 \converter latexclipboard lyx        "%% -fixedenc utf8 -f $$i $$o"    ""
-\converter literate   lyx        "%% -n -m noweb -f $$i $$o"   ""'''], not_found = 'tex2lyx')
+\converter literate   lyx        "%% -n -m noweb -f $$i $$o"   ""
+\converter sweave   lyx        "%% -n -m sweave -f $$i $$o"    ""
+\converter knitr   lyx        "%% -n -m knitr -f $$i $$o"      ""'''], not_found = 'tex2lyx')
     if path == '':
         logger.warning("Failed to find tex2lyx on your system.")
 
@@ -861,9 +864,18 @@ def checkConverterEntries():
     # Only define a converter from pdf6 for graphics
     checkProg('a PDF to EPS converter', ['pdftops -eps -f 1 -l 1 $$i $$o'],
         rc_entry = [ r'\converter pdf6        eps        "%%"  ""' ])
-    #
+    # Create one converter for a PDF produced using TeX fonts and one for a
+    # PDF produced using non-TeX fonts. This does not produce non-unique
+    # conversion paths, since a given document either uses TeX fonts or not.
     checkProg('a PDF cropping tool', ['pdfcrop $$i $$o'],
-        rc_entry = [ r'\converter pdf2   pdf7       "%%"       ""' ])
+        rc_entry = [ r'''\converter pdf2   pdf7       "%%"     ""
+\converter pdf4   pdf7       "%%"      ""''' ])
+    # Create one converter for a PDF produced using TeX fonts and one for a
+    # PDF produced using non-TeX fonts. This does not produce non-unique
+    # conversion paths, since a given document either uses TeX fonts or not.
+    checkProg('Ghostscript', ["gswin32c", "gswin64c", "gs"],
+        rc_entry = [ r'''\converter pdf2   pdf8       "python -tt $$s/scripts/convert_pdf.py $$i $$o ebook"    ""
+\converter pdf4   pdf8       "python -tt $$s/scripts/convert_pdf.py $$i $$o ebook"     ""''' ])
     #
     checkProg('a Beamer info extractor', ['makebeamerinfo -p $$i'],
         rc_entry = [ r'\converter pdf2         beamer.info        "%%" ""' ])
@@ -1462,7 +1474,7 @@ def rescanTeXFiles():
     if not os.path.isfile( os.path.join(srcdir, 'scripts', 'TeXFiles.py') ):
         logger.error("configure: error: cannot find TeXFiles.py script")
         sys.exit(1)
-    tfp = cmdOutput("python -tt " + os.path.join(srcdir, 'scripts', 'TeXFiles.py'))
+    tfp = cmdOutput("python -tt " + '"' + os.path.join(srcdir, 'scripts', 'TeXFiles.py') + '"')
     logger.info(tfp)
     logger.info("\tdone")
 
@@ -1479,7 +1491,7 @@ if __name__ == '__main__':
     lyx_check_config = True
     lyx_kpsewhich = True
     outfile = 'lyxrc.defaults'
-    lyxrc_fileformat = 16
+    lyxrc_fileformat = 17
     rc_entries = ''
     lyx_keep_temps = False
     version_suffix = ''