diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | popenasync.py | 6 | ||||
-rw-r--r-- | setup.py | 84 | ||||
m--------- | sources/pyside | 10 | ||||
m--------- | sources/pyside-tools | 0 | ||||
m--------- | sources/pyside-tools2 | 0 | ||||
m--------- | sources/pyside2 | 8 | ||||
m--------- | sources/shiboken | 10 | ||||
m--------- | sources/shiboken2 | 6 |
9 files changed, 69 insertions, 56 deletions
diff --git a/.gitignore b/.gitignore index c7a8ad416..5bd432665 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ *.pyc distribute-*.egg distribute-*.tar.gz +explore2 diff --git a/popenasync.py b/popenasync.py index df4944ee7..eb1a238fc 100644 --- a/popenasync.py +++ b/popenasync.py @@ -23,7 +23,9 @@ if sys.version_info >= (3,): else: null_byte = '\x00' -if subprocess.mswindows: +mswindows = (sys.platform == "win32") + +if mswindows: if sys.version_info >= (3,): # Test date should be in ascii. def encode(s): @@ -142,7 +144,7 @@ class Popen(subprocess.Popen): getattr(self, which).close() setattr(self, which, None) - if subprocess.mswindows: + if mswindows: def kill(self): # Recipes #http://me.in-berlin.de/doc/python/faq/windows.html#how-do-i-emulate-os-kill-in-windows @@ -26,9 +26,15 @@ OpenSSL: You can specify the location of OpenSSL DLLs with option --opnessl=</pa You can download OpenSSL for windows here: http://slproweb.com/products/Win32OpenSSL.html """ -__version__ = "1.3.0dev" +__version__ = "2.0.0.dev0" submodules = { + '2.0.0.dev0': [ + ["shiboken2", "qt5"], + ["pyside2", "qt5"], + ["pyside-tools2", "qt5"], + ["pyside-examples", "master"], + ], '1.3.0dev': [ ["shiboken", "master"], ["pyside", "master"], @@ -77,6 +83,8 @@ import os import sys import platform +import difflib # for a close match of dirname and module + from distutils import log from distutils.errors import DistutilsOptionError from distutils.errors import DistutilsSetupError @@ -197,8 +205,8 @@ if OPTION_NOEXAMPLES: for idx, item in enumerate(submodules[__version__]): if item[0] == 'pyside-examples': del submodules[__version__][idx] - - + + # Initialize, pull and checkout submodules if os.path.isdir(".git") and not OPTION_IGNOREGIT and not OPTION_ONLYPACKAGE: print("Initializing submodules for PySide version %s" % __version__) @@ -283,7 +291,7 @@ class pyside_build(_build): self.build_type = "Release" self.qtinfo = None self.build_tests = False - + def run(self): platform_arch = platform.architecture()[0] log.info("Python architecture is %s" % platform_arch) @@ -333,7 +341,7 @@ class pyside_build(_build): raise DistutilsSetupError( "Failed to find qmake." " Please specify the path to qmake with --qmake parameter.") - + # Prepare parameters py_executable = sys.executable py_version = "%s.%s" % (sys.version_info[0], sys.version_info[1]) @@ -383,7 +391,7 @@ class pyside_build(_build): # the lib and the normal one. This allows a debug PySide to # be built with a non-debug Python. lib_exts = [dbgPostfix + e for e in lib_exts] + lib_exts - + libs_tried = [] for lib_ext in lib_exts: lib_name = "libpython%s%s%s" % (py_version, lib_suff, lib_ext) @@ -422,25 +430,25 @@ class pyside_build(_build): if not qt_version: log.error("Failed to query the Qt version with qmake %s" % qtinfo.qmake_path) sys.exit(1) - + # Update the PATH environment variable update_env_path([py_scripts_dir, qt_dir]) - + build_name = "py%s-qt%s-%s-%s" % \ (py_version, qt_version, platform.architecture()[0], build_type.lower()) - + script_dir = os.getcwd() sources_dir = os.path.join(script_dir, "sources") build_dir = os.path.join(script_dir, "pyside_build", "%s" % build_name) install_dir = os.path.join(script_dir, "pyside_install", "%s" % build_name) - + # Try to ensure that tools built by this script (such as shiboken) # are found before any that may already be installed on the system. update_env_path([os.path.join(install_dir, 'bin')]) - - # Tell cmake to look here for *.cmake files + + # Tell cmake to look here for *.cmake files os.environ['CMAKE_PREFIX_PATH'] = install_dir - + self.make_path = make_path self.make_generator = make_generator self.debug = OPTION_DEBUG @@ -457,7 +465,7 @@ class pyside_build(_build): self.qtinfo = qtinfo self.site_packages_dir = get_python_lib(1, 0, prefix=install_dir) self.build_tests = OPTION_BUILDTESTS - + log.info("=" * 30) log.info("Package version: %s" % __version__) log.info("Build type: %s" % self.build_type) @@ -486,7 +494,7 @@ class pyside_build(_build): log.info("-" * 3) log.info("OpenSSL libs: %s" % OPTION_OPENSSL) log.info("=" * 30) - + # Prepare folders if not os.path.exists(self.sources_dir): log.info("Creating sources folder %s..." % self.sources_dir) @@ -497,7 +505,7 @@ class pyside_build(_build): if not os.path.exists(self.install_dir): log.info("Creating install folder %s..." % self.install_dir) os.makedirs(self.install_dir) - + if not OPTION_ONLYPACKAGE: # Build extensions for ext in ['shiboken', 'pyside', 'pyside-tools']: @@ -508,7 +516,7 @@ class pyside_build(_build): # Prepare packages self.prepare_packages() - + # Build packages _build.run(self) @@ -527,20 +535,28 @@ class pyside_build(_build): raise DistutilsSetupError("Error building patchelf") def build_extension(self, extension): + # calculate the subrepos folder name + maybe = list(map(lambda x:x[0], submodules[__version__])) + folder = difflib.get_close_matches(extension, maybe)[0] + log.info("Building module %s..." % extension) - + # Prepare folders os.chdir(self.build_dir) module_build_dir = os.path.join(self.build_dir, extension) + skipflag_file = module_build_dir + '-skip' + if os.path.exists(skipflag_file): + log.info("Skipping %s because %s exists" % (extension, skipflag_file)) + return if os.path.exists(module_build_dir): log.info("Deleting module build folder %s..." % module_build_dir) rmtree(module_build_dir) log.info("Creating module build folder %s..." % module_build_dir) os.makedirs(module_build_dir) os.chdir(module_build_dir) - - module_src_dir = os.path.join(self.sources_dir, extension) - + + module_src_dir = os.path.join(self.sources_dir, folder) + # Build module cmake_cmd = [ OPTION_CMAKE, @@ -573,34 +589,34 @@ class pyside_build(_build): cmake_cmd.append("-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=yes") if sys.version_info[0] > 2: cmake_cmd.append("-DUSE_PYTHON3=ON") - + if sys.platform == 'darwin': cmake_cmd.append('-DALTERNATIVE_QT_INCLUDE_DIR=' + self.qtinfo.headers_dir) - + if OPTION_OSXARCH: - # also tell cmake which architecture to use + # also tell cmake which architecture to use cmake_cmd.append("-DCMAKE_OSX_ARCHITECTURES:STRING={}".format(OPTION_OSXARCH)) log.info("Configuring module %s (%s)..." % (extension, module_src_dir)) if run_process(cmake_cmd) != 0: raise DistutilsSetupError("Error configuring " + extension) - + log.info("Compiling module %s..." % extension) cmd_make = [self.make_path] if OPTION_JOBS: cmd_make.append(OPTION_JOBS) if run_process(cmd_make) != 0: raise DistutilsSetupError("Error compiling " + extension) - + if extension.lower() == "shiboken": log.info("Generating Shiboken documentation %s..." % extension) if run_process([self.make_path, "doc"]) != 0: raise DistutilsSetupError("Error generating documentation " + extension) - + log.info("Installing module %s..." % extension) if run_process([self.make_path, "install/fast"]) != 0: raise DistutilsSetupError("Error pseudo installing " + extension) - + os.chdir(self.script_dir) def prepare_packages(self): @@ -751,7 +767,7 @@ class pyside_build(_build): self.update_rpath("{dist_dir}/PySide".format(**vars), executables) def prepare_packages_win32(self, vars): - pdbs = ['*.pdb'] if self.debug or self.build_type == 'RelWithDebInfo' else [] + pdbs = ['*.pdb'] if self.debug or self.build_type == 'RelWithDebInfo' else [] # <install>/lib/site-packages/PySide/* -> <setup>/PySide copydir( "{site_packages_dir}/PySide", @@ -778,7 +794,7 @@ class pyside_build(_build): copyfile( "{build_dir}/shiboken/shibokenmodule/shiboken{dbgPostfix}.pdb", "{dist_dir}/PySide/shiboken{dbgPostfix}.pdb", - vars=vars) + vars=vars) # <install>/lib/site-packages/pysideuic/* -> <setup>/pysideuic copydir( "{site_packages_dir}/pysideuic", @@ -837,7 +853,7 @@ class pyside_build(_build): "libeay32.dll", "ssleay32.dll"], force=False, vars=vars) - + # <qt>/bin/*.dll -> <setup>/PySide copydir("{qt_bin_dir}", "{dist_dir}/PySide", filter=[ @@ -860,7 +876,7 @@ class pyside_build(_build): copydir("{qt_lib_dir}", "{dist_dir}/PySide", filter=["*.pdb"], recursive=False, vars=vars) - + # I think these are the qt-mobility DLLs, at least some are, # so let's copy them too # <qt>/lib/*.dll -> <setup>/PySide @@ -878,7 +894,7 @@ class pyside_build(_build): copydir("{qt_lib_dir}", "{dist_dir}/PySide", filter=pdbs, recursive=False, vars=vars) - + # <qt>/plugins/* -> <setup>/PySide/plugins copydir("{qt_plugins_dir}", "{dist_dir}/PySide/plugins", filter=["*.dll"] + pdbs, @@ -1002,7 +1018,7 @@ setup( 'bdist_egg': pyside_bdist_egg, 'develop': pyside_develop, }, - + # Add a bogus extension module (will never be built here since we are # overriding the build command to do it using cmake) so things like # bdist_egg will know that there are extension modules and will name the diff --git a/sources/pyside b/sources/pyside deleted file mode 160000 -Subproject a12de51b654973d965b1888b4dd3c539422f71d diff --git a/sources/pyside-tools b/sources/pyside-tools deleted file mode 160000 -Subproject 8783dfcbb58f7d8c60aa0624fe6d99a36ba9a39 diff --git a/sources/pyside-tools2 b/sources/pyside-tools2 new file mode 160000 +Subproject d7f2a9bc3d228884235f19e1e73d132e7db39de diff --git a/sources/pyside2 b/sources/pyside2 new file mode 160000 +Subproject cd0f27e7219c64fe6a4a079892f75d1a6af726b diff --git a/sources/shiboken b/sources/shiboken deleted file mode 160000 -Subproject 43857068b0706f4a473c5f0a8d8c545ccab89cd diff --git a/sources/shiboken2 b/sources/shiboken2 new file mode 160000 +Subproject af111f1634bbaea5e7685fc89ae14dc2c293337 |