diff options
-rw-r--r-- | setup.py | 18 | ||||
-rw-r--r-- | sources/pyside2/PySide2/CMakeLists.txt | 19 | ||||
-rw-r--r-- | sources/pyside2/PySide2/qt.conf.in | 2 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pyside.cpp | 9 |
4 files changed, 47 insertions, 1 deletions
@@ -1557,6 +1557,12 @@ class pyside_build(_build): force=False, vars=vars) + # Copy the qt.conf file to libexec. + copyfile( + "{build_dir}/pyside2/PySide2/qt.conf", + "{pyside_package_dir}/PySide2/Qt/libexec", + vars=vars) + def prepare_standalone_package_osx(self, executables, vars): built_modules = vars['built_modules'] @@ -1643,6 +1649,12 @@ class pyside_build(_build): rpath = "@loader_path/../lib" osx_fix_rpaths_for_library(final_path, rpath) + # Copy the qt.conf file to libexec. + copyfile( + "{build_dir}/pyside2/PySide2/qt.conf", + "{pyside_package_dir}/PySide2/Qt/libexec", + vars=vars) + # <qt>/plugins/* -> <setup>/PySide2/Qt/plugins copydir("{qt_plugins_dir}", "{pyside_package_dir}/PySide2/Qt/plugins", @@ -1930,6 +1942,12 @@ class pyside_build(_build): filter=[filter], recursive=False, vars=vars) + # Copy the qt.conf file to prefix dir. + copyfile( + "{build_dir}/pyside2/PySide2/qt.conf", + "{pyside_package_dir}/PySide2", + vars=vars) + self.prepare_standalone_clang(is_win=True) # pdb files for libshiboken and libpyside diff --git a/sources/pyside2/PySide2/CMakeLists.txt b/sources/pyside2/PySide2/CMakeLists.txt index 971d0a9ef..651bf2734 100644 --- a/sources/pyside2/PySide2/CMakeLists.txt +++ b/sources/pyside2/PySide2/CMakeLists.txt @@ -13,6 +13,25 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/_config.py.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../pyside_version.py" "${CMAKE_CURRENT_BINARY_DIR}/_git_pyside_version.py" @ONLY) +# qt.conf needs to be placed next to QtWebEngineProcess so that the executable uses the correct +# Prefix location leading to an existing icu data file. It is needed on Windows, Linux, and macOS +# non-framework build. In framework build, instead of using qt.conf, Bundle querying is used. +if (WIN32 OR (UNIX AND NOT APPLE) OR (APPLE AND NOT QtCore_is_framework)) + + if (WIN32) + # On Windows, the QtWebEngineProcess is directly located in the Prefix, due to not using + # a "Qt" subfolder like on the other platforms. + set(QT_CONF_PREFIX ".") + else() + # On Linux and non-framework macOS, the QtWebEngineProcess is in ./libexec, so prefix is one + # level higher. + set(QT_CONF_PREFIX "..") + endif() + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/qt.conf.in" + "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" @ONLY) +endif() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/support/__init__.py" "${CMAKE_CURRENT_BINARY_DIR}/support/__init__.py" COPYONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/support/signature/__init__.py" diff --git a/sources/pyside2/PySide2/qt.conf.in b/sources/pyside2/PySide2/qt.conf.in new file mode 100644 index 000000000..ff5b0a30e --- /dev/null +++ b/sources/pyside2/PySide2/qt.conf.in @@ -0,0 +1,2 @@ +[Paths] +Prefix = @QT_CONF_PREFIX@ diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp index 4c7e6471c..1a59c87e0 100644 --- a/sources/pyside2/libpyside/pyside.cpp +++ b/sources/pyside2/libpyside/pyside.cpp @@ -494,7 +494,14 @@ bool registerInternalQtConf() // rccData needs to be static, otherwise when it goes out of scope, the Qt resource system // will point to invalid memory. - static QByteArray rccData = QByteArray("[Paths]\nPrefix = ") + prefixPath.toLocal8Bit(); + static QByteArray rccData = QByteArray("[Paths]\nPrefix = ") + prefixPath.toLocal8Bit() +#ifdef Q_OS_WIN + // LibraryExecutables needs to point to Prefix instead of ./bin because we don't + // currently conform to the Qt default directory layout on Windows. This is necessary + // for QtWebEngineCore to find the location of QtWebEngineProcess.exe. + + QByteArray("\nLibraryExecutables = ") + prefixPath.toLocal8Bit() +#endif + ; rccData.append('\n'); // The RCC data structure expects a 4-byte size value representing the actual data. |