]> git.lyx.org Git - lyx.git/blobdiff - lib/configure.py
Fix CMake for r31189.
[lyx.git] / lib / configure.py
index 914466bec21034af3e67962bd919a2e257fe9a1f..fecf2ab9526b0a23d3f2b9fd34c72c0e2cff0cf2 100644 (file)
@@ -359,6 +359,11 @@ def checkFormatEntries(dtl_tools):
 \Format text3      txt    "Plain text (ps2ascii)" "" ""        "%%"    "document"
 \Format text4      txt    "Plain text (catdvi)"   "" ""        "%%"    "document"
 \Format textparagraph txt "Plain Text, Join Lines" "" ""       "%%"    "document"''' ])
+ #
+    path, xhtmlview = checkViewer('an HTML previewer', ['firefox', 'mozilla file://$$p$$i', 'netscape'],
+        rc_entry = [r'\Format xhtml      html   "LyX HTML"              "" "%%" ""    "document"'])
+    if xhtmlview == "":
+        addToRC(r'\Format xhtml      html   "LyX HTML"              "" "" "%%"  "document"')
  #
     checkViewer('a BibTeX editor', ['sensible-editor', 'jabref', 'JabRef', \
         'pybliographic', 'bibdesk', 'gbib', 'kbib', \
@@ -372,7 +377,7 @@ def checkFormatEntries(dtl_tools):
     checkViewer('a Postscript previewer', ['kghostview', 'okular', 'evince', 'gv', 'ghostview -swap'],
         rc_entry = [r'''\Format eps        eps     EPS                    "" "%%"      ""      "vector"
 \Format ps         ps      Postscript             t  "%%"      ""      "document,vector"'''])
-    #
+    # for xdg-open issues look here: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg151818.html
     checkViewer('a PDF previewer', ['kpdf', 'okular', 'evince', 'kghostview', 'xpdf', 'acrobat', 'acroread', \
                    'gv', 'ghostview'],
         rc_entry = [r'''\Format pdf        pdf    "PDF (ps2pdf)"          P  "%%"      ""      "document,vector"
@@ -380,7 +385,7 @@ def checkFormatEntries(dtl_tools):
 \Format pdf3       pdf    "PDF (dvipdfm)"         m  "%%"      ""      "document,vector"
 \Format pdf4       pdf    "PDF (XeTeX)"           X  "%%"      ""      "document,vector"'''])
     #
-    checkViewer('a DVI previewer', ['xdvi', 'kdvi', 'okular'],
+    checkViewer('a DVI previewer', ['xdvi', 'kdvi', 'okular', 'yap', 'dviout -Set=!m'],
         rc_entry = [r'\Format dvi        dvi     DVI                    D  "%%"        ""      "document,vector"'])
     if dtl_tools:
         # Windows only: DraftDVI
@@ -460,10 +465,10 @@ def checkConverterEntries():
     checkProg('an MS Word -> LaTeX converter', ['wvCleanLatex $$i $$o'],
         rc_entry = [ r'\converter word       latex      "%%"   ""' ])
     #
-    path, elyxer = checkProg('a LyX -> HTML converter', ['elyxer.py $$i $$o'],
+    path, elyxer = checkProg('a LyX -> HTML converter', ['elyxer.py --directory $$r $$i $$o','elyxer --directory $$r $$i $$o'],
       rc_entry = [ r'\converter lyx      html       "%%"       ""' ])
-    if elyxer.find('elyxer.py') >= 0:
-      addToRC(r'''\copier    html       "python -tt $$s/scripts/ext_copy.py -e html,png,css $$i $$o"''')
+    if elyxer.find('elyxer') >= 0:
+      addToRC(r'''\copier    html       "python -tt $$s/scripts/ext_copy.py -e html,png,jpg,jpeg,css $$i $$o"''')
     else:
       # On SuSE the scripts have a .sh suffix, and on debian they are in /usr/share/tex4ht/
       path, htmlconv = checkProg('a LaTeX -> HTML converter', ['htlatex $$i', 'htlatex.sh $$i', \
@@ -538,7 +543,7 @@ def checkConverterEntries():
     else:
         addToRC(r'\converter lyxpreview png        ""  ""')
     #  
-    checkProg('a fax program', ['kdeprintfax $$i', 'ksendfax $$i'],
+    checkProg('a fax program', ['kdeprintfax $$i', 'ksendfax $$i', 'hylapex $$i'],
         rc_entry = [ r'\converter ps         fax        "%%"   ""'])
     #
     checkProg('a FIG -> EPS/PPM converter', ['fig2dev'],
@@ -673,8 +678,11 @@ def checkOtherEntries():
         alt_rc_entry = [ r'\index_alternatives "%%"' ])
     checkProg('an index processor appropriate to Japanese', ['mendex -c -q', 'makeindex -c -q'],
         rc_entry = [ r'\jindex_command "%%"' ])
-    checkProg('the splitindex processor', ['splitindex.pl', 'java splitindex', 'splitindex'],
+    path, splitindex = checkProg('the splitindex processor', ['splitindex.pl', 'splitindex'],
         rc_entry = [ r'\splitindex_command "%%"' ])
+    if splitindex == '':
+        checkProg('the splitindex processor (java version)', ['splitindex.class'],
+            rc_entry = [ r'\splitindex_command "java splitindex"' ])
     checkProg('a nomenclature processor', ['makeindex'],
         rc_entry = [ r'\nomencl_command "makeindex -s nomencl.ist"' ])
     ## FIXME: OCTAVE is not used anywhere
@@ -849,6 +857,7 @@ def checkModulesConfig():
 ## It has been automatically generated by configure
 ## Use "Options/Reconfigure" if you need to update it after a
 ## configuration change. 
+## "ModuleName" "filename" "Description" "Packages" "Requires" "Excludes" "Category"
 ''')
   # build the list of available modules
   foundClasses = []
@@ -870,22 +879,24 @@ def processModuleFile(file, bool_docbook):
 
         The top of a module file should look like this:
           #\DeclareLyXModule[LaTeX Packages]{ModuleName}
-          #BeginDescription
+          #DescriptionBegin
           #...body of description...
-          #EndDescription
+          #DescriptionEnd
           #Requires: [list of required modules]
           #Excludes: [list of excluded modules]
-        The last two lines are optional
+          #Category: [category name]
+        The last three lines are optional (though do give a category).
         We expect output:
-          "ModuleName" "filename" "Description" "Packages" "Requires" "Excludes"
+          "ModuleName" "filename" "Description" "Packages" "Requires" "Excludes" "Category"
     '''
     p = re.compile(r'\DeclareLyXModule\s*(?:\[([^]]*?)\])?{(.*)}')
     r = re.compile(r'#+\s*Requires: (.*)')
     x = re.compile(r'#+\s*Excludes: (.*)')
+    c = re.compile(r'#+\s*Category: (.*)')
     b = re.compile(r'#+\s*DescriptionBegin\s*$')
     e = re.compile(r'#+\s*DescriptionEnd\s*$')
 
-    modname = desc = pkgs = req = excl = ""
+    modname = desc = pkgs = req = excl = catgy = ""
     readingDescription = False
     descLines = []
     filename = file.split(os.sep)[-1]
@@ -925,8 +936,12 @@ def processModuleFile(file, bool_docbook):
         tmp = [s.strip() for s in excl.split("|")]
         excl = "|".join(tmp)
         continue
+      res = c.search(line)
+      if res != None:
+        catgy = res.group(1)
+        continue
     if modname != "":
-        return '"%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, desc, pkgs, req, excl)
+        return '"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, desc, pkgs, req, excl, catgy)
     logger.warning("Module file without \DeclareLyXModule line. ")
     return ""