depot/third_party/nixpkgs/pkgs/applications/gis/qgis/set-pyqt-package-dirs.patch
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

59 lines
2.5 KiB
Diff

diff --git a/cmake/FindPyQt5.cmake b/cmake/FindPyQt5.cmake
index b51fd0075e..87ee317e05 100644
--- a/cmake/FindPyQt5.cmake
+++ b/cmake/FindPyQt5.cmake
@@ -25,7 +25,7 @@ ELSE(EXISTS PYQT5_VERSION_STR)
IF(SIP_BUILD_EXECUTABLE)
# SIP >= 5.0 path
- FILE(GLOB _pyqt5_metadata "${Python_SITEARCH}/PyQt5-*.dist-info/METADATA")
+ FILE(GLOB _pyqt5_metadata "@pyQt5PackageDir@/PyQt5-*.dist-info/METADATA")
IF(_pyqt5_metadata)
FILE(READ ${_pyqt5_metadata} _pyqt5_metadata_contents)
STRING(REGEX REPLACE ".*\nVersion: ([^\n]+).*$" "\\1" PYQT5_VERSION_STR ${_pyqt5_metadata_contents})
@@ -34,8 +34,8 @@ ELSE(EXISTS PYQT5_VERSION_STR)
ENDIF(_pyqt5_metadata)
IF(PYQT5_VERSION_STR)
- SET(PYQT5_MOD_DIR "${Python_SITEARCH}/PyQt5")
- SET(PYQT5_SIP_DIR "${Python_SITEARCH}/PyQt5/bindings")
+ SET(PYQT5_MOD_DIR "@pyQt5PackageDir@/PyQt5")
+ SET(PYQT5_SIP_DIR "@pyQt5PackageDir@/PyQt5/bindings")
FIND_PROGRAM(__pyuic5 "pyuic5")
GET_FILENAME_COMPONENT(PYQT5_BIN_DIR ${__pyuic5} DIRECTORY)
diff --git a/cmake/FindQsci.cmake b/cmake/FindQsci.cmake
index 69e41c1fe9..5456c3d59b 100644
--- a/cmake/FindQsci.cmake
+++ b/cmake/FindQsci.cmake
@@ -24,7 +24,7 @@ ELSE(QSCI_MOD_VERSION_STR)
IF(SIP_BUILD_EXECUTABLE)
# SIP >= 5.0 path
- FILE(GLOB _qsci_metadata "${Python_SITEARCH}/QScintilla*.dist-info/METADATA")
+ FILE(GLOB _qsci_metadata "@qsciPackageDir@/QScintilla*.dist-info/METADATA")
IF(_qsci_metadata)
FILE(READ ${_qsci_metadata} _qsci_metadata_contents)
STRING(REGEX REPLACE ".*\nVersion: ([^\n]+).*$" "\\1" QSCI_MOD_VERSION_STR ${_qsci_metadata_contents})
@@ -33,7 +33,7 @@ ELSE(QSCI_MOD_VERSION_STR)
ENDIF(_qsci_metadata)
IF(QSCI_MOD_VERSION_STR)
- SET(QSCI_SIP_DIR "${PYQT5_SIP_DIR}")
+ SET(QSCI_SIP_DIR "@qsciPackageDir@/PyQt5/bindings")
SET(QSCI_FOUND TRUE)
ENDIF(QSCI_MOD_VERSION_STR)
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 4cd19c3af4..668cc6a5e6 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -206,7 +206,7 @@ if (WITH_GUI)
install(FILES ${QGIS_PYTHON_OUTPUT_DIRECTORY}/_gui.pyi DESTINATION ${QGIS_PYTHON_DIR})
endif()
if(QSCI_SIP_DIR)
- set(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -I ${QSCI_SIP_DIR})
+ set(SIP_BUILD_EXTRA_OPTIONS ${SIP_BUILD_EXTRA_OPTIONS} --include-dir=${QSCI_SIP_DIR})
else()
message(STATUS "Qsci sip file not found - disabling bindings for derived classes")
set(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_QSCI_SIP)