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

scipy-svn@scip... scipy-svn@scip...
Tue Oct 21 04:39:51 CDT 2008


Author: cdavid
Date: 2008-10-21 04:39:47 -0500 (Tue, 21 Oct 2008)
New Revision: 4818

Modified:
   trunk/tools/win32/build_scripts/pavement.py
Log:
Build nsis installer should work now.

Modified: trunk/tools/win32/build_scripts/pavement.py
===================================================================
--- trunk/tools/win32/build_scripts/pavement.py	2008-10-21 09:30:05 UTC (rev 4817)
+++ trunk/tools/win32/build_scripts/pavement.py	2008-10-21 09:39:47 UTC (rev 4818)
@@ -70,14 +70,12 @@
 
 @task
 def build_sdist():
-    cmd = ["python", "setup.py", "sdist", "--format=zip"]
-    st = subprocess.call(cmd, cwd=options.src_dir)
+    raw_build_sdist(options.src_dir)
 
 @task
 @needs('build_sdist')
 def bootstrap():
-    bdir = bootstrap_dir(options.pyver)
-    prepare_scipy_sources(options.src_dir, bdir)
+    raw_bootstrap(options.pyver, options.src_dir)
 
 @task
 def bootstrap_arch():
@@ -95,51 +93,21 @@
 def build_binary():
     pyver = options.pyver
     arch = options.arch
+    raw_build_arch(pyver, arch, options.src_root)
+
+@task
+@needs('clean')
+@needs('bootstrap')
+def build_nsis():
     scipy_verstr = get_scipy_version(options.src_root)
-    bdir = bootstrap_dir(pyver)
-    print "Building scipy (version %s) binary for python %s, arch is %s" % \
-          (scipy_verstr, get_python_exec(pyver), arch)
+    bdir = bootstrap_dir(options.pyver)
 
-    if BUILD_MSI:
-        cmd = [get_python_exec(pyver), "setup.py", "build", "-c", "mingw32",
-               "bdist_msi"]
-    else:
-        cmd = [get_python_exec(pyver), "setup.py", "build", "-c", "mingw32",
-               "bdist_wininst"]
-    build_log = "build-%s-%s.log" % (arch, pyver)
-    f = open(build_log, 'w')
+    for arch in ['nosse', 'sse2', 'sse3']:
+        raw_clean_bootstrap(options.pyver)
+        set_bootstrap_sources(arch, options.pyver)
+        prepare_nsis_script(bdir, pyver, scipy_verstr)
+        raw_build_arch(options.pyver, arch, options.src_root)
 
-    try:
-        try:
-            st = subprocess.call(cmd, #shell = True, 
-                            stderr = subprocess.STDOUT, stdout = f,
-                            cwd=bdir)
-            if st:
-                raise RuntimeError("The cmd failed with status %d" % st)
-        finally:
-            f.close()
-    except (subprocess.CalledProcessError, RuntimeError), e:
-        print e
-        msg = """
-There was an error while executing the following command:
-
-    %s
-
-Error was : %s
-
-Look at the build log (%s).""" % (cmd, str(e), build_log)
-        raise Exception(msg)
-
-    move_binary(arch, pyver, bdir, scipy_verstr)
-
-@task
-@needs('build_binary')
-@needs('bootstrap_arch')
-@needs('bootstrap_nsis')
-@needs('bootstrap')
-@needs('clean')
-def build_all():
-    pass
 # Helpers
 def set_bootstrap_sources(arch, pyver):
     bdir = bootstrap_dir(pyver)
@@ -302,3 +270,50 @@
     if pexists(pjoin(bdir, "site.cfg")):
         os.remove(pjoin(bdir, "site.cfg"))
 
+def raw_build_sdist(cwd):
+    cmd = ["python", "setup.py", "sdist", "--format=zip"]
+    st = subprocess.call(cmd, cwd=cwd)
+
+def raw_bootstrap(pyver, src_dir):
+    bdir = bootstrap_dir(pyver)
+    prepare_scipy_sources(src_dir, bdir)
+
+def raw_build_arch(pyver, arch, src_root):
+    scipy_verstr = get_scipy_version(src_root)
+    bdir = bootstrap_dir(pyver)
+
+    print "Building scipy (version %s) binary for python %s, arch is %s" % \
+          (scipy_verstr, get_python_exec(pyver), arch)
+
+    if BUILD_MSI:
+        cmd = [get_python_exec(pyver), "setup.py", "build", "-c", "mingw32",
+               "bdist_msi"]
+    else:
+        cmd = [get_python_exec(pyver), "setup.py", "build", "-c", "mingw32",
+               "bdist_wininst"]
+    build_log = "build-%s-%s.log" % (arch, pyver)
+    f = open(build_log, 'w')
+
+    try:
+        try:
+            st = subprocess.call(cmd, #shell = True,
+                            stderr = subprocess.STDOUT, stdout = f,
+                            cwd=bdir)
+            if st:
+                raise RuntimeError("The cmd failed with status %d" % st)
+        finally:
+            f.close()
+    except (subprocess.CalledProcessError, RuntimeError), e:
+        print e
+        msg = """
+There was an error while executing the following command:
+
+    %s
+
+Error was : %s
+
+Look at the build log (%s).""" % (cmd, str(e), build_log)
+        raise Exception(msg)
+
+    move_binary(arch, pyver, bdir, scipy_verstr)
+



More information about the Scipy-svn mailing list