From be8585ab74654943b461e81cbf0982d04a1ca9bb Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 2 Feb 2018 18:40:58 +0100 Subject: Fix deployment of Qt libraries on macOS for standalone packages Previously there was a selection process to choose which libraries to copy over in order to save time and space by not copying libraries for which there are no bindings. The logic was incomplete, and it would be a burden to always update it. Instead it seems that WebEngine is the predominant time consumer when copying, so just simplify the logic to the following: 1) If WebEngine bindings were generated, copy WebEngine Qt libraries 2) If not, don't 3) Copy all other Qt libraries Task-number: PYSIDE-604 Change-Id: Iaa832b5281c9c328f056fd5f9f42e251d55be75f Reviewed-by: Friedemann Kleint --- setup.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/setup.py b/setup.py index 83d179e45..673c11e81 100644 --- a/setup.py +++ b/setup.py @@ -1249,14 +1249,8 @@ class pyside_build(_build): def framework_dir_filter(dir_name, parent_full_path, dir_full_path): if '.framework' in dir_name: - if dir_name in ['QtWebEngine.framework', 'QtWebEngineCore.framework', \ - 'QtPositioning.framework', 'QtLocation.framework'] and \ - 'QtWebEngineWidgets.framework' in framework_built_modules: - return True - if dir_name in ['QtCLucene.framework'] and \ - 'QtHelp.framework' in framework_built_modules: - return True - if dir_name not in framework_built_modules: + if dir_name.startswith('QtWebEngine') and \ + 'QtWebEngineWidgets.framework' not in framework_built_modules: return False if dir_name in ['Headers', 'fonts']: return False @@ -1273,14 +1267,14 @@ class pyside_build(_build): ignore=["*.la", "*.a", "*.cmake", "*.pc", "*.prl"], dir_filter_function=framework_dir_filter) else: - if 'WebEngineWidgets' in built_modules: - built_modules.extend(['WebEngine', 'WebEngineCore', 'Positioning', 'Location']) - if 'Help' in built_modules: - built_modules.extend(['CLucene']) - prefixed_built_modules = ['*Qt5' + name + '*.dylib' for name in built_modules] + ignored_modules = [] + if 'WebEngineWidgets' not in built_modules: + ignored_modules.extend(['*Qt5WebEngine*.dylib']) + accepted_modules = ['*Qt5*.dylib'] copydir("{qt_lib_dir}", "{pyside_package_dir}/PySide2/Qt/lib", - filter=prefixed_built_modules, + filter=accepted_modules, + ignore=ignored_modules, recursive=True, vars=vars) if 'WebEngineWidgets' in built_modules: -- cgit v1.2.3