Bo Peng wrote:
Dear list,

Attached is a python version of lib/configure for 1.4.0 cvs. It is
written according to the m4 file at
http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/lib/configure.m4 .
Since I do not have access to lyx/cvs, I can only test it against
1.4.0pre1 from ftp.lyx.org.

Please test this script and report any problem here. Note that you
should diff sorted lyxrc.default files since configure.py does not
keep the original entry order.

Hi, Bo.

I've made some changes to configure.py in order to get it working well on Windows. See attached. The changes will need cleaning up but they allow me to run configure.py from a cmd console:

set PATH=J:\MinSYS\bin;C:\Python24;C:\MiKTeX\Main\miktex\bin;C:\PROGRA~1\Perl\bin;c:\program files\Ghostscript 8.33\gs8.33\bin;C:\Program Files\Ghostgum\gsview;C:\Program Files\ImageMagick-6.2.3-Q16;%PATH%

python configure.py

To compare the generated lyxrc.defaults to that produced by the existing configure script when run by LyX, I've manipulated the generated lyxrc.defaults from a a MinSYS terminal, so:

$ sed 's/TAB/ /g;s/ \{1,\}/ /g' $HOME/lyx/devel/build/lib/lyxrc.defaults | \
  sort > lyxrc_orig_sorted
$ sed 's/TAB/ /g;s/ \{1,\}/ /g' lyxrc.defaults > lyxrc_bopeng.defaults | \
  sort lyxrc_bopeng_sorted
$ diff -u lyxrc_orig_sorted lyxrc_bopeng_sorted | cat -e > lyxrc_changes
$ cat lyxrc_changes
@@ -84,8 +81,7 @@$
 \copier fig "sh $$s/scripts/fig_copy.sh $$i $$o"$
 \copier pdftex "python $$s/scripts/tex_copy.py $$i $$o $$l"$
 \copier pstex "python $$s/scripts/tex_copy.py $$i $$o $$l"$
-\font_encoding "T1"$
 \print_spool_command "lpr"$
 \print_spool_printerprefix "-P"$
 \spell_command "none"$
-\tex_allows_spaces true$
+\tex_allows_spaces false$

Note that I had to comment out the font_encoding command because chk_fontenc was not defined.

Please strip trailing whitespace from your script with
$ sed 's/ \{1,\}$//' configure.py
It changes the output in places, but I haven't attached the resulting diff because it makes it impossible to see what the substantive changes that I've made are.

Angus
--- configure_orig.py   Sat Sep 17 17:54:44 2005
+++ configure.py        Sat Sep 17 20:14:52 2005
@@ -184,8 +184,16 @@
     ac_prog = progs[idx]
     ac_word = ac_prog.split(' ')[0]
     print '+checking for "' + ac_word + '"... ', 
-    for ac_dir in os.environ['PATH'].split(':') + path:
+
+    path = os.environ["PATH"].split(os.pathsep) + path
+    for ac_dir in path:
+      success = False
       if os.path.isfile( os.path.join(ac_dir, ac_word) ):
+        success = True
+      if not success and \
+         os.path.isfile( os.path.join(ac_dir, ac_word + ".exe") ):
+        success = True
+      if success == True:
         print ' yes'
         # write rc entries for this command
         if len(rc_entry) == 1:
@@ -238,7 +246,7 @@
   rc_entry = [ r'\Format fig        fig     FIG                    "" "%%"     
"%%"'] )
 
 checkProg('a Grace viewer and editor', ['xmgrace'], 
-  rc_entry = [  r'\Format agr agr GRACE  "" "%%" "%%"' ] )
+  rc_entry = [  r'\Format agr agr Grace  "" "%%" "%%"' ] )
 
 checkProg('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'],
   rc_entry = [ r'\Format fen        fen     FEN                    "" "%%"     
"%%"' ])
@@ -262,7 +270,7 @@
   rc_entry = [
     r'''\Format asciichess asc    "Plain text (chess output)"  "" ""   "%%"
 \Format asciiimage asc    "Plain text (image)"         "" ""   "%%"
-\Format asciixfig  asc    "Plain text (xfig output)"   "" ""   "%%"
+\Format asciixfig  asc    "Plain text (Xfig output)"   "" ""   "%%"
 \Format dateout    tmp    "date (output)"         "" ""        "%%"
 \Format docbook    sgml    DocBook                B  ""        "%%"
 \Format docbook-xml xml   "Docbook (XML)"         "" ""        "%%"
@@ -342,7 +350,7 @@
   rc_entry = [
     r'\ascii_roff_command "groff -t -Tlatin1 $$FName"', 
     r'\ascii_roff_command "tbl $$FName | nroff"', 
-    '' ])
+    r'\ascii_roff_command "none"' ])
 
 checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'],
   rc_entry = [
@@ -351,7 +359,8 @@
 
 checkProg('a spellchecker', ['ispell'],
   rc_entry = [
-    r'\spell_command "ispell"', '' ] )
+    r'\spell_command "ispell"',
+    r'\spell_command "none"' ])
 
 ## FIXME: OCTAVE is not used anywhere
 path, OCTAVE = checkProg('Octave', ['octave'])
@@ -373,6 +382,7 @@
 \converter linuxdoc    dvi "none" ""
 \converter linuxdoc    html "none" "" ''' ])
 
+linuxdoc_cmd = ''
 if LINUXDOC != 'none':
   chk_linuxdoc = 'yes'
   bool_linuxdoc = 'true'
@@ -390,6 +400,7 @@
     r'''\converter docbook    dvi        "none" ""
 \converter docbook    html       "none" ""'''])
 
+docbook_cmd = ''
 if DOCBOOK != 'none':
   chk_docbook = 'yes'
   bool_docbook = 'true'
@@ -402,7 +413,7 @@
   rc_entry = [
     r'''\print_spool_printerprefix "-d "
 \print_spool_command "lp"''',
-    r'''\print_spool_printerprefix "-P"',
+    r'''\print_spool_printerprefix "-P"
 \print_spool_command "lpr"''',
     ''])
 
@@ -592,9 +603,8 @@
 
 ### Let's check whether spaces are allowed in TeX file names
 print "Checking whether TeX allows spaces in file names... ",
-if not lyx_check_config:
   tex_allows_spaces = 'false'
-else:
+if lyx_check_config:
   file = open('a b.tex', 'w')
   file.write(r'\message{working^^J}' )
   file.close()
@@ -636,7 +646,7 @@
 \converter agr ppm     "gracebat -hardcopy -printfile $$o -hdevice PNM $$i 
2>/dev/null" ""''',
     ''])
 
-addToRC(r'\font_encoding "%s"' % chk_fontenc)
+#addToRC(r'\font_encoding "%s"' % chk_fontenc)
 addToRC(r'\tex_allows_spaces ' + tex_allows_spaces)
 
 if use_cygwin_path_fix == 'true':

Reply via email to