From 7c40b2babe3e7b787cf0a42422a1e67c66e8a164 Mon Sep 17 00:00:00 2001 From: "Robin Dunn (cyclops)" Date: Mon, 28 Jan 2013 16:59:23 +0000 Subject: Also copy the DLLs in the lib dir if there are any, that's where qt-mobility puts its DLLs --- setup.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index aff9fa63b..72662d6f5 100644 --- a/setup.py +++ b/setup.py @@ -159,7 +159,7 @@ Use --list-versions option to get list of available versions""" % OPTION_VERSION __version__ = OPTION_VERSION # Initialize, pull and checkout submodules -if os.path.isdir(".git") and not OPTION_IGNOREGIT: +if os.path.isdir(".git") and not OPTION_IGNOREGIT and not OPTION_ONLYPACKAGE: print("Initializing submodules for PySide version %s" % __version__) git_update_cmd = ["git", "submodule", "update", "--init"] if run_process(git_update_cmd) != 0: @@ -769,6 +769,21 @@ class pyside_build(_build): copydir("{qt_bin_dir}", "{dist_dir}/PySide", filter=["*d4.dll"], recursive=False, logger=log, vars=vars) + + # I think these are the qt-mobility DLLs, at least some are, + # so let's copy them too + # /lib/*.dll -> /PySide + copydir("{qt_lib_dir}", "{setup_dir}/PySide", + filter=["*.dll"], + ignore=["*d?.dll"], + recursive=False, logger=log, vars=vars) + if self.debug: + # /lib/*d4.dll -> /PySide + copydir("{qt_lib_dir}", "{setup_dir}/PySide", + filter=["*d?.dll"], + recursive=False, logger=log, vars=vars) + + # /plugins/* -> /PySide/plugins copydir("{qt_plugins_dir}", "{dist_dir}/PySide/plugins", filter=["*.dll"], @@ -850,4 +865,4 @@ setup( 'bdist_egg': pyside_bdist_egg, 'install': pyside_install, }, -) \ No newline at end of file +) -- cgit v1.2.3 From 4e5b120cb769496513ed4ee760a6fbc0d38b34d5 Mon Sep 17 00:00:00 2001 From: "Robin Dunn (cyclops)" Date: Thu, 7 Feb 2013 10:56:55 -0800 Subject: Copy some additional files on Windows when doing debug builds. Also set and use the "_d" posfix where needed --- setup.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 72662d6f5..a78d07a3c 100644 --- a/setup.py +++ b/setup.py @@ -521,6 +521,9 @@ class pyside_build(_build): cmake_cmd.append("-DPYTHON_LIBRARY=%s" % self.py_library) if self.build_type.lower() == 'debug': cmake_cmd.append("-DPYTHON_DEBUG_LIBRARY=%s" % self.py_library) + if sys.platform == "win32" and self.build_type.lower() == 'debug': + cmake_cmd.append("-DCMAKE_DEBUG_POSTFIX=_d") + if extension.lower() == "shiboken": cmake_cmd.append("-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=yes") if sys.version_info[0] > 2: @@ -572,6 +575,7 @@ class pyside_build(_build): } os.chdir(self.script_dir) if sys.platform == "win32": + vars['dbgPostfix'] = OPTION_DEBUG and "_d" or "" return self.prepare_packages_win32(vars) return self.prepare_packages_posix(vars) @@ -704,8 +708,8 @@ class pyside_build(_build): force=False, logger=log, vars=vars) # /lib/site-packages/shiboken.pyd -> /PySide/shiboken.pyd copyfile( - "{install_dir}/lib/site-packages/shiboken.pyd", - "{dist_dir}/PySide/shiboken.pyd", + "{install_dir}/lib/site-packages/shiboken{dbgPostfix}.pyd", + "{dist_dir}/PySide/shiboken{dbgPostfix}.pyd", logger=log, vars=vars) # /lib/site-packages/pysideuic/* -> /pysideuic copydir( @@ -753,6 +757,7 @@ class pyside_build(_build): "libeay32.dll", "ssleay32.dll"], force=False, logger=log, vars=vars) + # /bin/*.dll -> /PySide copydir("{qt_bin_dir}", "{dist_dir}/PySide", filter=[ @@ -770,6 +775,11 @@ class pyside_build(_build): filter=["*d4.dll"], recursive=False, logger=log, vars=vars) + # /lib/*.pdb -> /PySide + copydir("{qt_lib_dir}", "{setup_dir}/PySide", + filter=["*.pdb"], + recursive=False, logger=log, vars=vars) + # I think these are the qt-mobility DLLs, at least some are, # so let's copy them too # /lib/*.dll -> /PySide -- cgit v1.2.3 From d5ba61e5d07153626bf4c948b66eb872516c6989 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 29 Apr 2013 13:31:41 -0700 Subject: Add a bogus Extension object so setuptools will know that there are binary extensions and will use the platform and architecture in the egg file name. --- setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a78d07a3c..3223b656f 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ from distutils.sysconfig import get_config_var from distutils.spawn import find_executable from distutils.command.build import build as _build -from setuptools import setup +from setuptools import setup, Extension from setuptools.command.install import install as _install from setuptools.command.bdist_egg import bdist_egg as _bdist_egg @@ -875,4 +875,12 @@ setup( 'bdist_egg': pyside_bdist_egg, '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 + # dist with the full platform info. + ext_modules = [Extension('QtCore', [])], + ext_package = 'PySide', + ) -- cgit v1.2.3 From 8a1db87a2319c626601904c9d10d65e470beb1fb Mon Sep 17 00:00:00 2001 From: "Robin Dunn (cyclops)" Date: Mon, 25 Mar 2013 13:35:01 -0700 Subject: Add a release-with-debug-info (relwithdebinfo) build mode, which will build normal release mode binaries, but will also include the *.pdb files in the install or egg, to facilitate debugging on Windows without needing a full debug build. --- setup.py | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 3223b656f..ef87e6e7a 100644 --- a/setup.py +++ b/setup.py @@ -87,6 +87,7 @@ from utils import get_environment_from_batch_command # Declare options OPTION_DEBUG = has_option("debug") +OPTION_RELWITHDEBINFO = has_option('relwithdebinfo') OPTION_QMAKE = option_value("qmake") OPTION_CMAKE = option_value("cmake") OPTION_OPENSSL = option_value("openssl") @@ -164,6 +165,9 @@ if os.path.isdir(".git") and not OPTION_IGNOREGIT and not OPTION_ONLYPACKAGE: git_update_cmd = ["git", "submodule", "update", "--init"] if run_process(git_update_cmd) != 0: raise DistutilsSetupError("Failed to initialize the git submodules") + git_pull_cmd = ["git", "submodule", "foreach", "git", "fetch", "origin"] + if run_process(git_pull_cmd) != 0: + raise DistutilsSetupError("Failed to initialize the git submodules") git_pull_cmd = ["git", "submodule", "foreach", "git", "pull", "origin", "master"] if run_process(git_pull_cmd) != 0: raise DistutilsSetupError("Failed to initialize the git submodules") @@ -318,6 +322,8 @@ class pyside_build(_build): # Prepare parameters build_type = OPTION_DEBUG and "Debug" or "Release" + if OPTION_RELWITHDEBINFO: + build_type = 'RelWithDebInfo' py_executable = sys.executable py_version = "%s.%s" % (sys.version_info[0], sys.version_info[1]) py_include_dir = get_config_var("INCLUDEPY") @@ -689,17 +695,18 @@ class pyside_build(_build): logger=log, vars=vars) def prepare_packages_win32(self, vars): + pdbs = ['*.pdb'] if self.debug or self.build_type == 'RelWithDebInfo' else [] # /lib/site-packages/PySide/* -> /PySide copydir( "{install_dir}/lib/site-packages/PySide", "{dist_dir}/PySide", logger=log, vars=vars) - if self.debug: + if self.debug or self.build_type == 'RelWithDebInfo': # /pyside/PySide/*.pdb -> /PySide copydir( "{build_dir}/pyside/PySide", "{dist_dir}/PySide", - filter=["*.pdb"], + filter=pdbs, recursive=False, logger=log, vars=vars) # /shiboken/doc/html/* -> /PySide/docs/shiboken copydir( @@ -711,6 +718,11 @@ class pyside_build(_build): "{install_dir}/lib/site-packages/shiboken{dbgPostfix}.pyd", "{dist_dir}/PySide/shiboken{dbgPostfix}.pyd", logger=log, vars=vars) + if self.debug or self.build_type == 'RelWithDebInfo': + copyfile( + "{build_dir}/shiboken/shibokenmodule/shiboken{dbgPostfix}.pdb", + "{setup_dir}/PySide/shiboken{dbgPostfix}.pdb", + logger=log, vars=vars) # /lib/site-packages/pysideuic/* -> /pysideuic copydir( "{install_dir}/lib/site-packages/pysideuic", @@ -724,11 +736,11 @@ class pyside_build(_build): "{install_dir}/bin/pyside-uic", "{dist_dir}/PySide/scripts/uic.py", force=False, logger=log, vars=vars) - # /bin/*.exe,*.dll -> PySide/ + # /bin/*.exe,*.dll,*.pdb -> PySide/ copydir( "{install_dir}/bin/", "{dist_dir}/PySide", - filter=["*.exe", "*.dll"], + filter=["*.exe", "*.dll"] + pdbs, recursive=False, logger=log, vars=vars) # /lib/*.lib -> PySide/ copydir( @@ -772,9 +784,10 @@ class pyside_build(_build): if self.debug: # /bin/*d4.dll -> /PySide copydir("{qt_bin_dir}", "{dist_dir}/PySide", - filter=["*d4.dll"], + filter=["*d4.dll"] + pdbs, recursive=False, logger=log, vars=vars) + if self.debug or self.build_type == 'RelWithDebInfo': # /lib/*.pdb -> /PySide copydir("{qt_lib_dir}", "{setup_dir}/PySide", filter=["*.pdb"], @@ -792,15 +805,19 @@ class pyside_build(_build): copydir("{qt_lib_dir}", "{setup_dir}/PySide", filter=["*d?.dll"], recursive=False, logger=log, vars=vars) - + if self.debug or self.build_type == 'RelWithDebInfo': + # /lib/*pdb -> /PySide + copydir("{qt_lib_dir}", "{setup_dir}/PySide", + filter=pdbs, + recursive=False, logger=log, vars=vars) # /plugins/* -> /PySide/plugins copydir("{qt_plugins_dir}", "{dist_dir}/PySide/plugins", - filter=["*.dll"], + filter=["*.dll"] + pdbs, logger=log, vars=vars) # /imports/* -> /PySide/imports copydir("{qt_imports_dir}", "{dist_dir}/PySide/imports", - filter=["qmldir", "*.dll"], + filter=["qmldir", "*.dll"] + pdbs, logger=log, vars=vars) # /translations/* -> /PySide/translations copydir("{qt_translations_dir}", "{dist_dir}/PySide/translations", -- cgit v1.2.3 From 93253fa987cb6395aba8b45fde3849f89944af6b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 29 Apr 2013 15:06:19 -0700 Subject: Fix some setup_dir --> dist_dir that were missed in the rebase. --- setup.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index ef87e6e7a..f1f336c39 100644 --- a/setup.py +++ b/setup.py @@ -721,7 +721,7 @@ class pyside_build(_build): if self.debug or self.build_type == 'RelWithDebInfo': copyfile( "{build_dir}/shiboken/shibokenmodule/shiboken{dbgPostfix}.pdb", - "{setup_dir}/PySide/shiboken{dbgPostfix}.pdb", + "{dist_dir}/PySide/shiboken{dbgPostfix}.pdb", logger=log, vars=vars) # /lib/site-packages/pysideuic/* -> /pysideuic copydir( @@ -789,25 +789,25 @@ class pyside_build(_build): if self.debug or self.build_type == 'RelWithDebInfo': # /lib/*.pdb -> /PySide - copydir("{qt_lib_dir}", "{setup_dir}/PySide", + copydir("{qt_lib_dir}", "{dist_dir}/PySide", filter=["*.pdb"], recursive=False, logger=log, vars=vars) # I think these are the qt-mobility DLLs, at least some are, # so let's copy them too # /lib/*.dll -> /PySide - copydir("{qt_lib_dir}", "{setup_dir}/PySide", + copydir("{qt_lib_dir}", "{dist_dir}/PySide", filter=["*.dll"], ignore=["*d?.dll"], recursive=False, logger=log, vars=vars) if self.debug: # /lib/*d4.dll -> /PySide - copydir("{qt_lib_dir}", "{setup_dir}/PySide", + copydir("{qt_lib_dir}", "{dist_dir}/PySide", filter=["*d?.dll"], recursive=False, logger=log, vars=vars) if self.debug or self.build_type == 'RelWithDebInfo': # /lib/*pdb -> /PySide - copydir("{qt_lib_dir}", "{setup_dir}/PySide", + copydir("{qt_lib_dir}", "{dist_dir}/PySide", filter=pdbs, recursive=False, logger=log, vars=vars) -- cgit v1.2.3