Commits

mattip committed 950a858

try to make packaging windows more robust but more prone to packaging nonsense

Comments (0)

Files changed (1)

pypy/tool/release/package.py

         rename_pypy_c += '.exe'
     binaries = [(pypy_c, rename_pypy_c)]
     #
+    builddir = udir.ensure("build", dir=True)
+    pypydir = builddir.ensure(name, dir=True)
+    includedir = basedir.join('include')
+    pypydir.ensure('include', dir=True)
+
     if sys.platform == 'win32':
         #Don't include a mscvrXX.dll, users should get their own.
         #Instructions are provided on the website.
             p = pypy_c.dirpath().join(extra)
             if not p.check():
                 p = py.path.local.sysfind(extra)
-                assert p, "%s not found" % (extra,)
+                if not p:
+                    print "%s not found, expect trouble if this is a shared build" % (extra,)
+                    continue
             print "Picking %s" % p
             binaries.append((p, p.basename))
-    #
-    builddir = udir.ensure("build", dir=True)
-    pypydir = builddir.ensure(name, dir=True)
+        if pypy_c.dirpath().join("libpypy-c.lib").check():
+            shutil.copyfile(str(pypy_c.dirpath().join("libpypy-c.lib")),
+                        str(pypydir.join('include/python27.lib')))
+            print "Picking %s as %s" % (pypy_c.dirpath().join("libpypy-c.lib"),
+                        pypydir.join('include/python27.lib'))
+        else:
+            pass
+            # XXX users will complain that they cannot compile cpyext
+            # modules for windows, has the lib moved or are there no
+            # exported functions in the dll so no import library is created?
+
     # Careful: to copy lib_pypy, copying just the svn-tracked files
     # would not be enough: there are also ctypes_config_cache/_*_cache.py.
     shutil.copytree(str(basedir.join('lib-python').join(STDLIB_VER)),
                                            '*.c', '*.o'))
     for file in ['LICENSE', 'README.rst']:
         shutil.copy(str(basedir.join(file)), str(pypydir))
-    pypydir.ensure('include', dir=True)
-    if sys.platform == 'win32':
-        shutil.copyfile(str(pypy_c.dirpath().join("libpypy-c.lib")),
-                        str(pypydir.join('include/python27.lib')))
-    # we want to put there all *.h and *.inl from trunk/include
-    # and from pypy/_interfaces
-    includedir = basedir.join('include')
     headers = includedir.listdir('*.h') + includedir.listdir('*.inl')
     for n in headers:
+        # we want to put there all *.h and *.inl from trunk/include
+        # and from pypy/_interfaces
         shutil.copy(str(n), str(pypydir.join('include')))
     #
     spdir = pypydir.ensure('site-packages', dir=True)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.