[neon/qt/qtwebengine/Neon/release_jammy] debian: Add upstream patches to stop using imp Python module.

Soren Stoutner null at kde.org
Wed Aug 21 09:44:47 BST 2024


Git commit b65d7466be0c25c08c647d50813b63e6856c2383 by Soren Stoutner, on behalf of Dmitry Shachnev.
Committed on 08/05/2024 at 00:19.
Pushed by jriddell into branch 'Neon/release_jammy'.

Add upstream patches to stop using imp Python module.

Thanks Zixing Liu!

M  +2    -0    debian/changelog
A  +50   -0    debian/patches/python3.12-imp.patch
M  +1    -0    debian/patches/series

https://invent.kde.org/neon/qt/qtwebengine/-/commit/b65d7466be0c25c08c647d50813b63e6856c2383

diff --git a/debian/changelog b/debian/changelog
index 8a708db..7f62e7f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,8 @@ qtwebengine-opensource-src (5.15.15+dfsg-4) UNRELEASED; urgency=medium
   [ Dmitry Shachnev ]
   * Add a patch from Gentoo to fix build with ICU 74.
   * Replace pkg-config build-dependency with pkgconf.
+  * Add upstream patches to stop using imp Python module (LP: #2058066).
+    Thanks Zixing Liu!
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Tue, 07 May 2024 16:40:19 -0700
 
diff --git a/debian/patches/python3.12-imp.patch b/debian/patches/python3.12-imp.patch
new file mode 100644
index 0000000..5214bfc
--- /dev/null
+++ b/debian/patches/python3.12-imp.patch
@@ -0,0 +1,50 @@
+Description: stop using imp module which was removed in Python 3.12
+Origin: upstream, commits
+ https://chromium.googlesource.com/chromium/src/+/9e0c89a3b5638ba2
+ https://chromium.googlesource.com/chromium/src/+/f5f6e361d037c316
+Last-Update: 2024-03-17
+
+--- a/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
++++ b/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py
+@@ -9,7 +9,7 @@
+ """
+ from __future__ import print_function
+ import abc
+-import imp
++from importlib import util as imp_util
+ import optparse
+ import os
+ import re
+@@ -68,7 +68,11 @@ class GoogleProtobufModuleImporter:
+       raise ImportError(fullname)
+ 
+     filepath = self._fullname_to_filepath(fullname)
+-    return imp.load_source(fullname, filepath)
++    spec = imp_util.spec_from_file_location(fullname, filepath)
++    loaded = imp_util.module_from_spec(spec)
++    spec.loader.exec_module(loaded)
++
++    return loaded
+ 
+ class BinaryProtoGenerator:
+ 
+--- a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/fileutil.py
++++ b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/fileutil.py
+@@ -3,7 +3,6 @@
+ # found in the LICENSE file.
+ 
+ import errno
+-import imp
+ import os.path
+ import sys
+ 
+--- a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/parse/lexer.py
++++ b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/parse/lexer.py
+@@ -2,7 +2,6 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+ 
+-import imp
+ import os.path
+ import sys
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 115c30e..2f1a2e4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,6 +8,7 @@ system-icu-utf.patch
 python3.patch
 chromium-python3.patch
 python3.11.patch
+python3.12-imp.patch
 
 # General patches.
 verbose-gn-bootstrap.patch



More information about the Neon-commits mailing list