[pypy-commit] pypy pypyw: package pypyw, fix cffi module build for obscure Python27.lib location

mattip noreply at buildbot.pypy.org
Fri May 22 00:04:23 CEST 2015


Author: mattip <matti.picus at gmail.com>
Branch: pypyw
Changeset: r77463:bdf636c4383d
Date: 2015-05-22 01:01 +0300
http://bitbucket.org/pypy/pypy/changeset/bdf636c4383d/

Log:	package pypyw, fix cffi module build for obscure Python27.lib
	location

diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -54,7 +54,11 @@
     shutil.rmtree(str(basedir.join('lib_pypy', '__pycache__')),
                   ignore_errors=True)
     modules = ['_sqlite3_build.py', '_audioop_build.py']
-    if not sys.platform == 'win32':
+    env = os.environ.copy()
+    if sys.platform == 'win32':
+        # obscure. Add the location of pypy_c so Python27.lib can be found
+        env['LIB'] = env.get('LIB', '') + ';' + str(pypy_c.dirpath())
+    else:
         modules += ['_curses_build.py', '_syslog_build.py', '_gdbm_build.py',
                     '_pwdgrp_build.py']
     if not options.no_tk:
@@ -68,7 +72,7 @@
             cwd = None
         print >> sys.stderr, '*', ' '.join(args)
         try:
-            subprocess.check_call(args, cwd=cwd)
+            subprocess.check_call(args, cwd=cwd, env=env)
         except subprocess.CalledProcessError:
             print >>sys.stderr, """Building {0} bindings failed.
 You can either install development headers package or
@@ -142,6 +146,12 @@
     pypydir.ensure('include', dir=True)
 
     if sys.platform == 'win32':
+        src,tgt = binaries[0]
+        pypyw = src.new(purebasename=src.purebasename + 'w')
+        if pypyw.exists():
+            tgt = py.path.local(tgt)
+            binaries.append((pypyw, tgt.new(purebasename=tgt.purebasename + 'w').basename))
+            print "Picking %s" % str(pypyw)
         # Can't rename a DLL: it is always called 'libpypy-c.dll'
         win_extras = ['libpypy-c.dll', 'sqlite3.dll']
         if not options.no_tk:


More information about the pypy-commit mailing list