-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
pyqt_sip_dir-sip5.patch
34 lines (28 loc) · 1.2 KB
/
pyqt_sip_dir-sip5.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From c3cba340cfca43f216522464de5fd6f3e060718b Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev <mitya57@gmail.com>
Date: Sat, 4 Jul 2020 13:01:27 +0300
Subject: [PATCH] Update pyqt_sip_dir for pyqt5 compiled with sip5
---
https://github.com/KDE/krita/commit/c3cba340cfca43f216522464de5fd6f3e060718b
cmake/modules/FindPyQt5.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git cmake/modules/FindPyQt5.py cmake/modules/FindPyQt5.py
index e0ef9d7bdb..e138ad3107 100644
--- cmake/modules/FindPyQt5.py
+++ cmake/modules/FindPyQt5.py
@@ -4,6 +4,7 @@
import sys
import os
+from distutils.sysconfig import get_python_lib
try:
# On Windows and Python 3.8+ python doesn't load module DLL's
@@ -40,8 +41,9 @@
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")
+pyqt_sip_dir = os.path.join(get_python_lib(plat_specific=1), "PyQt5", "bindings")
+if not os.path.exists(pyqt_sip_dir): # Fallback for older PyQt5/SIP
+ pyqt_sip_dir = os.path.join(sys.prefix, "share", "sip", "PyQt5")
print("pyqt_sip_dir:%s" % pyqt_sip_dir)
print("pyqt_sip_flags:%s" % PyQt5.QtCore.PYQT_CONFIGURATION["sip_flags"])