Accepting request 1246028 from KDE:Qt:5.15

python 3.12 / 3.13 compat

OBS-URL: https://build.opensuse.org/request/show/1246028
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtwebengine?expand=0&rev=104
This commit is contained in:
Dominique Leuenberger 2025-02-16 21:36:48 +00:00 committed by Git OBS Bridge
commit 00bf3777d7
5 changed files with 122 additions and 0 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Feb 14 16:17:54 UTC 2025 - Christophe Marin <christophe@krop.fr>
- Add patches:
* python3.12-imp.patch
* python3.12-six.patch
* python3.13-pipes.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Dec 03 13:23:13 UTC 2024 - christophe@krop.fr Tue Dec 03 13:23:13 UTC 2024 - christophe@krop.fr

View File

@ -64,6 +64,10 @@ Patch6: Add-missing-dependencies.patch
# PATCH-FIX-UPSTREAM -- ICU 75 compatibility # PATCH-FIX-UPSTREAM -- ICU 75 compatibility
Patch7: qt5-webengine-icu-75.patch Patch7: qt5-webengine-icu-75.patch
Patch8: 0001-Use-default-constructor-in-place-of-self-delegation-.patch Patch8: 0001-Use-default-constructor-in-place-of-self-delegation-.patch
# PATCH-FIX-UPSTREAM -- python >= 3.12 compat
Patch9: python3.12-imp.patch
Patch10: python3.12-six.patch
Patch11: python3.13-pipes.patch
### Patch 50-99 are applied conditionally ### Patch 50-99 are applied conditionally
# PATCH-FIX-OPENSUSE -- allow building qtwebengine with ffmpeg5 # PATCH-FIX-OPENSUSE -- allow building qtwebengine with ffmpeg5
Patch50: qtwebengine-ffmpeg5.patch Patch50: qtwebengine-ffmpeg5.patch
@ -304,6 +308,9 @@ Examples for the libqt5-qtpdf module.
%patch -P6 -p1 %patch -P6 -p1
%patch -P7 -p1 %patch -P7 -p1
%patch -P8 -p1 %patch -P8 -p1
%patch -P9 -p1
%patch -P10 -p1
%patch -P11 -p1
# FFmpeg 5 # FFmpeg 5
%if %{with system_ffmpeg} %if %{with system_ffmpeg}

24
python3.12-imp.patch Normal file
View File

@ -0,0 +1,24 @@
Description: stop using imp module which was removed in Python 3.12
Origin: upstream, https://chromium.googlesource.com/chromium/src/+/f5f6e361d037c316
Last-Update: 2024-06-30
--- 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

56
python3.12-six.patch Normal file
View File

@ -0,0 +1,56 @@
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]

27
python3.13-pipes.patch Normal file
View File

@ -0,0 +1,27 @@
Description: replace removed pipes module with shlex
Origin: upstream, https://chromium.googlesource.com/chromium/src/+/4c6fc1984970af4b
Last-Update: 2025-01-08
--- a/src/3rdparty/chromium/build/android/gyp/util/build_utils.py
+++ b/src/3rdparty/chromium/build/android/gyp/util/build_utils.py
@@ -12,8 +12,8 @@ import fnmatch
import json
import logging
import os
-import pipes
import re
+import shlex
import shutil
import stat
import subprocess
@@ -197,8 +197,9 @@ class CalledProcessError(Exception):
def __str__(self):
# A user should be able to simply copy and paste the command that failed
# into their shell.
+ printed_cmd = shlex.join(self.args)
copyable_command = '( cd {}; {} )'.format(os.path.abspath(self.cwd),
- ' '.join(map(pipes.quote, self.args)))
+ printed_cmd)
return 'Command failed: {}\n{}'.format(copyable_command, self.output)