Commit 858f19a8 authored by Antonio Rojas's avatar Antonio Rojas

Always use the same sipname as PyQt

PyQt>=5.11 uses 'PyQt.sip' sipname by default, but some distributions (such ad Debian) patch it to use 'sip'. Get the sipname from the PyQt configuration instead of setting it depending on the PyQt version.

Differential Revision: https://phabricator.kde.org/D14182
parent da6eb244
......@@ -42,6 +42,9 @@ ELSE(EXISTS PYQT5_VERSION)
STRING(REGEX REPLACE ".*\npyqt_version_tag:([^\n]+).*$" "\\1" PYQT5_VERSION_TAG ${pyqt5_config})
STRING(REGEX REPLACE ".*\npyqt_sip_dir:([^\n]+).*$" "\\1" PYQT5_SIP_DIR ${pyqt5_config})
STRING(REGEX REPLACE ".*\npyqt_sip_flags:([^\n]+).*$" "\\1" PYQT5_SIP_FLAGS ${pyqt5_config})
IF(${pyqt5_config} MATCHES pyqt_sip_name)
STRING(REGEX REPLACE ".*\npyqt_sip_name:([^\n]+).*$" "\\1" PYQT5_SIP_NAME ${pyqt5_config})
ENDIF(${pyqt5_config} MATCHES pyqt_sip_name)
SET(PYQT5_FOUND TRUE)
ENDIF(pyqt5_config)
......
......@@ -11,7 +11,8 @@ print("pyqt_version_str:%s" % PyQt5.Qt.PYQT_VERSION_STR)
pyqt_version_tag = ""
in_t = False
for item in PyQt5.Qt.PYQT_CONFIGURATION["sip_flags"].split(' '):
pyqt_config_list = PyQt5.Qt.PYQT_CONFIGURATION["sip_flags"].split(' ')
for item in pyqt_config_list:
if item == "-t":
in_t = True
elif in_t:
......@@ -21,6 +22,13 @@ for item in PyQt5.Qt.PYQT_CONFIGURATION["sip_flags"].split(' '):
in_t = False
print("pyqt_version_tag:%s" % pyqt_version_tag)
try:
index_n = pyqt_config_list.index('-n')
pyqt_sip_name = '-n' + pyqt_config_list[index_n + 1]
print("pyqt_sip_name:%s" % pyqt_sip_name)
except ValueError:
pass
# FIXME This next line is just a little bit too crude.
pyqt_sip_dir = os.path.join(sys.prefix, "share", "sip", "PyQt5")
print("pyqt_sip_dir:%s" % pyqt_sip_dir)
......
......@@ -12,13 +12,9 @@ set(SIP_INCLUDES
${PYQT_SIP_DIR_OVERRIDE}
./krita)
if(${PYQT5_VERSION_STR} VERSION_EQUAL "5.11.0" OR ${PYQT5_VERSION_STR} VERSION_GREATER "5.11.0")
set(SIP_NAME -n PyQt5.sip)
endif()
set(SIP_CONCAT_PARTS 1)
set(SIP_TAGS ALL WS_X11 ${PYQT5_VERSION_TAG})
set(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector ${SIP_NAME})
set(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector ${PYQT5_SIP_NAME})
set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${LIB_INSTALL_DIR}/krita-python-libs)
file(GLOB PYKRITA_KRITA_sip_files ./krita/*.sip)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment