summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2026-05-13 11:07:50 +0300
committerSharlatan Hellseher <sharlatanus@gmail.com>2026-05-18 14:37:09 +0100
commit254135b1732760919791f79582ed0e095762586b (patch)
tree8774caf80a620305ef4ea8e69000d1b6824fa679
parentfdd482a08499740d487f70b664ff817791310f69 (diff)
gnu: qtwebengine-5: Fix build with python@3.12.
* gnu/packages/qt.scm (qtwebengine-5)[source]: Add a patch to adjust python-six. Add to the snippet to work around 'imp' being removed from python@3.12. * gnu/packages/patches/qtwebengine5-python312-six-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Fixes: guix/guix#8576 Change-Id: Ib202d3eb50764ed46c57610e9abdbb4db118362a
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/qtwebengine5-python312-six-compat.patch60
-rw-r--r--gnu/packages/qt.scm7
3 files changed, 68 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index e6e58d3c12..5c4b848258 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2141,6 +2141,7 @@ dist_patch_DATA = \
%D%/packages/patches/qtdeclarative-disable-qmlcache.patch \
%D%/packages/patches/qtlocation-5.15.8-mapboxgl-gcc13.patch \
%D%/packages/patches/qtwebengine-revert-egl.patch \
+ %D%/packages/patches/qtwebengine5-python312-six-compat.patch \
%D%/packages/patches/quodlibet-disable-bundled-packages.patch \
%D%/packages/patches/qxlsx-fix-include-directory.patch \
%D%/packages/patches/schiffbruch-fix-build-for-gcc-13.patch \
diff --git a/gnu/packages/patches/qtwebengine5-python312-six-compat.patch b/gnu/packages/patches/qtwebengine5-python312-six-compat.patch
new file mode 100644
index 0000000000..ede61935cd
--- /dev/null
+++ b/gnu/packages/patches/qtwebengine5-python312-six-compat.patch
@@ -0,0 +1,60 @@
+Patch itself taken from Debian:
+https://sources.debian.org/data/main/q/qtwebengine-opensource-src/5.15.18%2Bdfsg-2/debian/patches/python3.12-six.patch
+Debian used it until qtwebengine-5.15.19.
+
+Description: implement find_spec() for _SixMetaPathImporter
+Origin: upstream, https://github.com/benjaminp/six/commit/25916292d96f5f09
+Last-Update: 2024-03-17
+
+--- a/src/3rdparty/chromium/third_party/protobuf/third_party/six/six.py
++++ b/src/3rdparty/chromium/third_party/protobuf/third_party/six/six.py
+@@ -71,6 +71,11 @@ else:
+ MAXSIZE = int((1 << 63) - 1)
+ del X
+
++if PY34:
++ from importlib.util import spec_from_loader
++else:
++ spec_from_loader = None
++
+
+ def _add_doc(func, doc):
+ """Add documentation to a function."""
+@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object):
+ return self
+ return None
+
++ def find_spec(self, fullname, path, target=None):
++ if fullname in self.known_modules:
++ return spec_from_loader(fullname, self)
++ return None
++
+ def __get_module(self, fullname):
+ try:
+ return self.known_modules[fullname]
+--- a/src/3rdparty/chromium/tools/grit/third_party/six/__init__.py
++++ b/src/3rdparty/chromium/tools/grit/third_party/six/__init__.py
+@@ -71,6 +71,11 @@ else:
+ MAXSIZE = int((1 << 63) - 1)
+ del X
+
++if PY34:
++ from importlib.util import spec_from_loader
++else:
++ spec_from_loader = None
++
+
+ def _add_doc(func, doc):
+ """Add documentation to a function."""
+@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object):
+ return self
+ return None
+
++ def find_spec(self, fullname, path, target=None):
++ if fullname in self.known_modules:
++ return spec_from_loader(fullname, self)
++ return None
++
+ def __get_module(self, fullname):
+ try:
+ return self.known_modules[fullname]
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 80f7a90e99..8cf476c166 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3655,6 +3655,7 @@ using the Enchant spell-checking library.")
(sha256
(base32
"11hir1dwsfy96jxmsmadcr46m034dpjlnpqw60nqk6wk0qscxvg8"))
+ (patches (search-patches "qtwebengine5-python312-six-compat.patch"))
(modules '((ice-9 ftw)
(ice-9 match)
(srfi srfi-1)
@@ -3808,6 +3809,12 @@ using the Enchant spell-checking library.")
;; preserved above.
#$remove-third-party-files
+ ;; For compatibility with python-3.12 remove 'import imp'.
+ ;; This can be removed with qtwebengine@5.15.19.
+ (substitute* '("mojo/public/tools/mojom/mojom/fileutil.py"
+ "mojo/public/tools/mojom/mojom/parse/lexer.py")
+ (("import imp\n") ""))
+
;; Use relative header locations instead of hard coded ones.
(substitute*
"base/third_party/dynamic_annotations/dynamic_annotations.c"