1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-06-19 07:04:05 +02:00
Files
guix/gnu/packages/patches/qtwebengine5-python312-six-compat.patch
Efraim Flashner 4bec804ff0 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
2026-05-24 10:19:40 +01:00

61 lines
1.9 KiB
Diff

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]