diff options
author | Antonio Rojas <arojas@archlinux.org> | 2018-09-30 22:46:18 +0200 |
---|---|---|
committer | Antonio Rojas <arojas@archlinux.org> | 2018-09-30 22:46:18 +0200 |
commit | 05bd97492704029647d442d0f83acb9e6436ed53 (patch) | |
tree | 479a9172b38f99acfc1f37c3506b2463ba1f6b0b | |
parent | 453ba4fee3126648e8ba4cadbef13207e02b1461 (diff) | |
download | extra-cmake-modules-5.51.0.tar.gz extra-cmake-modules-5.51.0.tar.bz2 |
Compile python bindings with the same sip flags used by PyQtv5.51.0-rc1v5.51.0
PyQt>=5.11 is compiled with the 'PyQt5.sip' sipname by default. This causes a sipname mismatch with KF5 bindings and prevents them from loading:
To fix this, we compile KF5 bindings using the same sip flags (name and tags) that PyQt was compiled with. This ensures that we always use the correct sip name. We also stop setting the sip tags in FindPythonModuleGeneration.cmake to avoid duplication, and remove a (seemingly) unnecessary check for the Qt version that was forcing PyQt to be rebuilt for every patch Qt update.
Differential Revision: https://phabricator.kde.org/D15091
-rw-r--r-- | find-modules/FindPythonModuleGeneration.cmake | 23 | ||||
-rwxr-xr-x | find-modules/run-sip.py | 3 |
2 files changed, 3 insertions, 23 deletions
diff --git a/find-modules/FindPythonModuleGeneration.cmake b/find-modules/FindPythonModuleGeneration.cmake index 24559b63..15f89f0f 100644 --- a/find-modules/FindPythonModuleGeneration.cmake +++ b/find-modules/FindPythonModuleGeneration.cmake @@ -254,20 +254,6 @@ if(NOT SIP_Qt5Core_Mod_FILE) _report_NOT_FOUND("PyQt module files not found for the ${CMAKE_FIND_PACKAGE_NAME} Module.") endif() -file(STRINGS "${SIP_Qt5Core_Mod_FILE}" _SIP_Qt5_VERSIONS - REGEX "^%Timeline" -) - -string(REGEX MATCHALL "Qt_5_[^ }]+" _SIP_Qt5_VERSIONS "${_SIP_Qt5_VERSIONS}") - -set(GPB_Qt5_Tag Qt_5_${Qt5Core_VERSION_MINOR}_${Qt5Core_VERSION_PATCH}) - -list(FIND _SIP_Qt5_VERSIONS ${GPB_Qt5_Tag} _SIP_Qt5_Version_Index) - -if(_SIP_Qt5_Version_Index EQUAL -1) - _report_NOT_FOUND("PyQt module \"${SIP_Qt5Core_Mod_FILE}\" does not support Qt version 5.${Qt5Core_VERSION_MINOR}.${Qt5Core_VERSION_PATCH} for the ${CMAKE_FIND_PACKAGE_NAME} Module. Found available Qt5 tags: \"${_SIP_Qt5_VERSIONS}\".") -endif() - set(PythonModuleGeneration_FOUND TRUE) include(CMakeParseArguments) @@ -411,14 +397,6 @@ headers = sipAPI${GPB_MODULENAME} endif() endforeach() - if (WIN32) - set(GPB_WS_Tag -t WS_WIN) - elif(APPLE) - set(GPB_WS_Tag -t WS_MACX) - else() - set(GPB_WS_Tag -t WS_X11) - endif() - add_custom_target(generate_${GPB_MODULENAME}_sip_files ALL DEPENDS ${sip_files}) add_custom_command(OUTPUT @@ -428,7 +406,6 @@ headers = sipAPI${GPB_MODULENAME} --module-name "${GPB_MODULENAME}" -c "${CMAKE_CURRENT_BINARY_DIR}/pybuild/${GPB_PYTHONNAMESPACE}/${GPB_MODULENAME}" -b "${CMAKE_CURRENT_BINARY_DIR}/pybuild/${GPB_PYTHONNAMESPACE}/${GPB_MODULENAME}/module.sbf" - -t ${GPB_Qt5_Tag} ${GPB_WS_Tag} -x VendorID -x Py_v3 diff --git a/find-modules/run-sip.py b/find-modules/run-sip.py index 74c84861..fc8a5e2b 100755 --- a/find-modules/run-sip.py +++ b/find-modules/run-sip.py @@ -6,6 +6,9 @@ import subprocess sipArgs = sys.argv[1:] +from PyQt5.Qt import PYQT_CONFIGURATION +sipArgs = PYQT_CONFIGURATION["sip_flags"].split(' ') + sipArgs + idx = sipArgs.index("--module-name") modname = sipArgs[idx + 1] del sipArgs[idx] |