[Scipy-svn] r4812 - trunk/tools/win32/build_scripts

scipy-svn@scip... scipy-svn@scip...
Tue Oct 21 01:43:20 CDT 2008


Author: cdavid
Date: 2008-10-21 01:43:17 -0500 (Tue, 21 Oct 2008)
New Revision: 4812

Modified:
   trunk/tools/win32/build_scripts/pavement.py
Log:
Generate nsis script in bootstrap task.

Modified: trunk/tools/win32/build_scripts/pavement.py
===================================================================
--- trunk/tools/win32/build_scripts/pavement.py	2008-10-21 06:26:54 UTC (rev 4811)
+++ trunk/tools/win32/build_scripts/pavement.py	2008-10-21 06:43:17 UTC (rev 4812)
@@ -44,6 +44,10 @@
         arch = ARCH,
         src_root = SRC_ROOT
     ),
+    bootstrap=Bunch(
+        pyver = PYVER,
+        src_root = SRC_ROOT
+    ),
     bootstrap_arch=Bunch(
         pyver = PYVER,
         arch = ARCH
@@ -85,7 +89,9 @@
 @task
 @needs('build_sdist')
 def bootstrap():
-    prepare_scipy_sources(options.src_dir, bootstrap_dir(options.pyver))
+    bdir = bootstrap_dir(options.pyver)
+    prepare_scipy_sources(options.src_dir, bdir)
+    prepare_nsis_script(bootstrap, pyver, get_scipy_version(options.src_root))
 
 @task
 def bootstrap_arch():
@@ -162,6 +168,20 @@
         fid = open(newname, 'wb')
         fid.write(cnt)
 
+def prepare_nsis_script(bootstrap, pyver, numver):
+    tpl = pjoin('nsis_scripts', 'scipy-superinstaller.nsi.in')
+    source = open(tpl, 'r')
+    target = open(pjoin(bootstrap, 'scipy-superinstaller.nsi'), 'w')
+
+    installer_name = 'scipy-%s-win32-superpack-python%s.exe' % (numver, pyver)
+    cnt = "".join(source.readlines())
+    cnt = cnt.replace('@SCIPY_INSTALLER_NAME@', installer_name)
+    for arch in ['nosse', 'sse2', 'sse3']:
+        cnt = cnt.replace('@%s_BINARY@' % arch.upper(),
+                          get_binary_name(arch))
+
+    target.write(cnt)
+
 def bootstrap_dir(pyver):
     return pjoin(BUILD_ROOT, "bootstrap-%s" % pyver)
 



More information about the Scipy-svn mailing list