]> git.lyx.org Git - lyx.git/blobdiff - development/scons/scons_utils.py
Rename files under src/tex2lyx
[lyx.git] / development / scons / scons_utils.py
index 59458a0ba4d5f1d74e36257ce1b3d715e873b96a..bb924cafc86d2c5248871278c0a04b4c020301f6 100644 (file)
@@ -83,7 +83,7 @@ def env_nsis(source, target, env, for_signature):
             return '"' + str + '"'
         else:
             return str
-    ret = env['NSIS'] + " /V2 "
+    ret = env['NSIS'] + " /V1 "
     if env.has_key('NSISFLAGS'):
         for flag in env['NSISFLAGS']:
             ret += flag
@@ -94,11 +94,35 @@ def env_nsis(source, target, env, for_signature):
             if env['NSISDEFINES'][d]:
                 ret += '=' + quoteIfSpaced(env['NSISDEFINES'][d])
             ret += ' '
+    # bundled?
+    if '-bundle.exe' in str(target[0]):
+        ret += '/DSETUPTYPE_BUNDLE=1 '
     for s in source:
         ret += quoteIfSpaced(str(s))
     return ret
 
 
+def env_toc(target, source, env):
+    '''Generate target from source files'''
+    # this is very tricky because we need to use installed lyx2lyx with 
+    # correct lyx2lyx_version.py
+    sys.path.append(env['LYX2LYX_DEST'])
+    sys.path.append(env.Dir('$TOP_SRCDIR/lib/doc').abspath)
+    import doc_toc
+    # build toc
+    doc_toc.build_toc(str(target[0]), [file.abspath for file in source])
+    
+    
+def env_cat(target, source, env):
+    '''Cat source > target. Avoid pipe to increase portability'''
+    output = open(env.File(target[0]).abspath, 'w')
+    for src in source:
+        input = open(env.File(src).abspath)
+        output.write(input.read())
+        input.close()
+    output.close()
+
+
 def createResFromIcon(env, icon_file, rc_file):
     ''' create a rc file with icon, and return res file (windows only) '''
     if os.name == 'nt':
@@ -700,7 +724,7 @@ def installCygwinPostinstallScript(path):
     ''' Install lyx.sh '''
     postinstall_script = os.path.join(path, 'lyx.sh')
     script = open(postinstall_script, 'w')
-    script.write('''#!/bin/sh
+    script.write(r'''#!/bin/sh
 
 # Add /usr/share/lyx/fonts to /etc/fonts/local.conf
 # if it is not already there.