Skip to content

Commit

Permalink
hookutils: qt: fix QtWebEngineCore helper collection for Homebrew
Browse files Browse the repository at this point in the history
With Homebrew python and Qt, we are collecting the Qt libraries
from system-wide installation, into top-level application
directory (while preserving the .framework bundle directories).

So the extra helper files from QtWebEngineCore.framework bundle
need to be collected into QtWebEngineCore.framework directory in
top-level application directory instead of the sub-directory
in PySide/PyQt package directory.
  • Loading branch information
rokm committed May 30, 2023
1 parent 5f8bb4b commit fc273d3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions PyInstaller/utils/hooks/qt/__init__.py
Expand Up @@ -691,10 +691,18 @@ def collect_qtwebengine_files(self):

if is_macos_framework:
# macOS .framework bundle
data_path = self.location['DataPath']

src_framework_path = os.path.join(data_path, 'lib', 'QtWebEngineCore.framework')
dst_framework_path = os.path.join(rel_data_path, 'lib', 'QtWebEngineCore.framework')
src_framework_path = os.path.join(self.location['LibrariesPath'], 'QtWebEngineCore.framework')

# If Qt libraries are bundled with the package, collect the .framework bundle into corresponding package's
# subdirectory, because binary dependency analysis will also try to preserve the directory structure.
# However, if we are collecting from system-wide Qt installation (e.g., Homebrew-installed Qt), the binary
# depndency analysis will attempt to re-create .framework bundle in top-level directory, so we need to
# collect the extra files there.
bundled_qt_libs = pathlib.Path(self.package_location) in pathlib.Path(src_framework_path).parents
if bundled_qt_libs:
dst_framework_path = os.path.join(rel_data_path, 'lib', 'QtWebEngineCore.framework')
else:
dst_framework_path = 'QtWebEngineCore.framework' # In top-level directory

# Collect files from QtWebEngineCore.framework/Helpers
helper_datas = hooks.collect_system_data_files(
Expand Down

0 comments on commit fc273d3

Please sign in to comment.