diff options
Diffstat (limited to 'build_scripts/platforms/windows_desktop.py')
-rw-r--r-- | build_scripts/platforms/windows_desktop.py | 108 |
1 files changed, 58 insertions, 50 deletions
diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py index a5a5b8fd2..6b92c0823 100644 --- a/build_scripts/platforms/windows_desktop.py +++ b/build_scripts/platforms/windows_desktop.py @@ -43,8 +43,8 @@ import sys import fnmatch from ..config import config -from ..options import * -from ..utils import copydir, copyfile, rmtree, makefile +from ..options import OPTION +from ..utils import copydir, copyfile, makefile from ..utils import regenerate_qt_resources, filter_match from ..utils import download_and_extract_7z @@ -197,7 +197,7 @@ def prepare_packages_win32(self, vars): copydir( "{build_dir}/pyside2/{st_package_name}", "{st_build_dir}/{st_package_name}", - filter=["*.pyi"], + filter=["*.pyi", "py.typed"], vars=vars) copydir( @@ -206,7 +206,7 @@ def prepare_packages_win32(self, vars): filter=pdbs, recursive=False, vars=vars) - if not OPTION_NOEXAMPLES: + if not OPTION["NOEXAMPLES"]: def pycache_dir_filter(dir_name, parent_full_path, dir_full_path): if fnmatch.fnmatch(dir_name, "__pycache__"): return False @@ -223,16 +223,15 @@ def prepare_packages_win32(self, vars): pyside_rcc_path = "{install_dir}/bin/rcc.exe".format( **vars) pyside_rcc_options = ['-g', 'python'] - regenerate_qt_resources(examples_path, pyside_rcc_path, - pyside_rcc_options) + regenerate_qt_resources(examples_path, pyside_rcc_path, pyside_rcc_options) if vars['ssl_libs_dir']: # <ssl_libs>/* -> <setup>/{st_package_name}/openssl copydir("{ssl_libs_dir}", "{st_build_dir}/{st_package_name}/openssl", - filter=[ - "libeay32.dll", - "ssleay32.dll"], - force=False, vars=vars) + filter=[ + "libeay32.dll", + "ssleay32.dll"], + force=False, vars=vars) if config.is_internal_shiboken_module_build(): # The C++ std library dlls need to be packaged with the @@ -241,6 +240,7 @@ def prepare_packages_win32(self, vars): if config.is_internal_pyside_build() or config.is_internal_shiboken_generator_build(): copy_qt_artifacts(self, copy_pdbs, vars) + copy_msvc_redist_files(vars, "{build_dir}/msvc_redist".format(**vars)) def copy_msvc_redist_files(vars, redist_target_path): @@ -252,7 +252,11 @@ def copy_msvc_redist_files(vars, redist_target_path): "vcamp140.dll", "vccorlib140.dll", "vcomp140.dll", - "vcruntime140.dll" + "vcruntime140.dll", + "vcruntime140_1.dll", + "msvcp140_1.dll", + "msvcp140_2.dll", + "msvcp140_codecvt_ids.dll" ] # Make a directory where the files should be extracted. @@ -263,10 +267,15 @@ def copy_msvc_redist_files(vars, redist_target_path): in_coin = os.environ.get('COIN_LAUNCH_PARAMETERS', None) if in_coin is not None: redist_url = "http://download.qt.io/development_releases/prebuilt/vcredist/" - zip_file = "pyside_qt_deps_64.7z" + zip_file = "pyside_qt_deps_64_2019.7z" if "{target_arch}".format(**vars) == "32": - zip_file = "pyside_qt_deps_32.7z" - download_and_extract_7z(redist_url + zip_file, redist_target_path) + zip_file = "pyside_qt_deps_32_2019.7z" + try: + download_and_extract_7z(redist_url + zip_file, redist_target_path) + except: + print("download.qt.io is down, try with mirror") + redist_url = "https://www.funet.fi/pub/mirrors/download.qt-project.org/development_releases/prebuilt/vcredist/" + download_and_extract_7z(redist_url + zip_file, redist_target_path) else: print("Qt dependency DLLs (MSVC redist) will not be downloaded and extracted.") @@ -382,19 +391,21 @@ def copy_qt_artifacts(self, copy_pdbs, vars): # e.g. "/home/work/qt/qtbase/bin" file_path_dir_name = os.path.dirname(file_full_path) # e.g. "Qt5Coredd" - maybe_debug_name = file_base_name + 'd' + maybe_debug_name = "{}d".format(file_base_name) if self.debug: filter = debug - def predicate(path): return not os.path.exists(path) + + def predicate(path): + return not os.path.exists(path) else: filter = release - def predicate(path): return os.path.exists(path) + + def predicate(path): + return os.path.exists(path) # e.g. "/home/work/qt/qtbase/bin/Qt5Coredd.dll" - other_config_path = os.path.join(file_path_dir_name, - maybe_debug_name + file_ext) + other_config_path = os.path.join(file_path_dir_name, maybe_debug_name + file_ext) - if (filter_match(file_name, filter) and - predicate(other_config_path)): + if (filter_match(file_name, filter) and predicate(other_config_path)): return True return False @@ -411,19 +422,18 @@ def copy_qt_artifacts(self, copy_pdbs, vars): pdb_pattern = "*{}.pdb" if copy_pdbs: plugin_dll_patterns += [pdb_pattern] - plugin_dll_filter = functools.partial(qt_build_config_filter, - plugin_dll_patterns) + plugin_dll_filter = functools.partial(qt_build_config_filter, plugin_dll_patterns) copydir("{qt_plugins_dir}", "{st_build_dir}/{st_package_name}/plugins", - file_filter_function=plugin_dll_filter, - vars=vars) + file_filter_function=plugin_dll_filter, + vars=vars) if copy_translations: # <qt>/translations/* -> <setup>/{st_package_name}/translations copydir("{qt_translations_dir}", - "{st_build_dir}/{st_package_name}/translations", - filter=["*.qm", "*.pak"], - force=False, - vars=vars) + "{st_build_dir}/{st_package_name}/translations", + filter=["*.qm", "*.pak"], + force=False, + vars=vars) if copy_qml: # <qt>/qml/* -> <setup>/{st_package_name}/qml @@ -433,43 +443,41 @@ def copy_qt_artifacts(self, copy_pdbs, vars): # Copy all files that are not dlls and pdbs (.qml, qmldir). copydir("{qt_qml_dir}", "{st_build_dir}/{st_package_name}/qml", - ignore=qml_ignore, - force=False, - recursive=True, - vars=vars) + ignore=qml_ignore, + force=False, + recursive=True, + vars=vars) if copy_pdbs: qml_dll_patterns += [pdb_pattern] - qml_dll_filter = functools.partial(qt_build_config_filter, - qml_dll_patterns) + qml_dll_filter = functools.partial(qt_build_config_filter, qml_dll_patterns) # Copy all dlls (and possibly pdbs). copydir("{qt_qml_dir}", "{st_build_dir}/{st_package_name}/qml", - file_filter_function=qml_dll_filter, - force=False, - recursive=True, - vars=vars) + file_filter_function=qml_dll_filter, + force=False, + recursive=True, + vars=vars) if self.is_webengine_built(built_modules): copydir("{qt_prefix_dir}/resources", - "{st_build_dir}/{st_package_name}/resources", - filter=None, - recursive=False, - vars=vars) + "{st_build_dir}/{st_package_name}/resources", + filter=None, + recursive=False, + vars=vars) filter = 'QtWebEngineProcess{}.exe'.format( 'd' if self.debug else '') copydir("{qt_bin_dir}", - "{st_build_dir}/{st_package_name}", - filter=[filter], - recursive=False, vars=vars) + "{st_build_dir}/{st_package_name}", + filter=[filter], + recursive=False, vars=vars) if copy_qt_conf: # Copy the qt.conf file to prefix dir. - copyfile( - "{build_dir}/pyside2/{st_package_name}/qt.conf", - "{st_build_dir}/{st_package_name}", - vars=vars) + copyfile("{build_dir}/pyside2/{st_package_name}/qt.conf", + "{st_build_dir}/{st_package_name}", + vars=vars) if copy_clang: self.prepare_standalone_clang(is_win=True) |