From c0a80fb3b6047308617605729738936e2ea28e6f Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Wed, 10 Jun 2015 10:39:52 +0200 Subject: create pyside-tools2 with qt5 branch --- setup.py | 66 ++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index a0b1bcee7..1e3496b5e 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ submodules = { '2.0.0.dev0': [ ["shiboken2", "qt5"], ["pyside2", "qt5"], - ["pyside-tools", "master"], + ["pyside-tools2", "qt5"], ["pyside-examples", "master"], ], '1.3.0dev': [ @@ -204,8 +204,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__) @@ -312,7 +312,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) @@ -362,7 +362,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]) @@ -412,7 +412,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) @@ -451,25 +451,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 @@ -486,7 +486,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) @@ -515,7 +515,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) @@ -526,7 +526,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']: @@ -537,7 +537,7 @@ class pyside_build(_build): # Prepare packages self.prepare_packages() - + # Build packages _build.run(self) @@ -561,7 +561,7 @@ class pyside_build(_build): 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) @@ -575,9 +575,9 @@ class pyside_build(_build): 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, folder) - + # Build module cmake_cmd = [ OPTION_CMAKE, @@ -610,34 +610,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): @@ -788,7 +788,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 [] # /lib/site-packages/PySide/* -> /PySide copydir( "{site_packages_dir}/PySide", @@ -815,7 +815,7 @@ class pyside_build(_build): copyfile( "{build_dir}/shiboken/shibokenmodule/shiboken{dbgPostfix}.pdb", "{dist_dir}/PySide/shiboken{dbgPostfix}.pdb", - vars=vars) + vars=vars) # /lib/site-packages/pysideuic/* -> /pysideuic copydir( "{site_packages_dir}/pysideuic", @@ -874,7 +874,7 @@ class pyside_build(_build): "libeay32.dll", "ssleay32.dll"], force=False, vars=vars) - + # /bin/*.dll -> /PySide copydir("{qt_bin_dir}", "{dist_dir}/PySide", filter=[ @@ -897,7 +897,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 # /lib/*.dll -> /PySide @@ -915,7 +915,7 @@ class pyside_build(_build): copydir("{qt_lib_dir}", "{dist_dir}/PySide", filter=pdbs, recursive=False, vars=vars) - + # /plugins/* -> /PySide/plugins copydir("{qt_plugins_dir}", "{dist_dir}/PySide/plugins", filter=["*.dll"] + pdbs, @@ -1044,7 +1044,7 @@ setup( 'develop': pyside_develop, 'install': pyside_install, }, - + # 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 -- cgit v1.2.3