From 3497beef8cd1c9e346b998aa744be653a06e59e12e03ca97f90faab5d152a472 Mon Sep 17 00:00:00 2001 From: Christophe Marin Date: Sat, 29 Apr 2023 08:39:42 +0000 Subject: [PATCH] Accepting request 1083615 from home:dirkmueller:branches:KDE:Qt:5.15 - add python311-fixes.patch: * Fix build when python3 is python 3.11+ OBS-URL: https://build.opensuse.org/request/show/1083615 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.15/libqt5-qtwebengine?expand=0&rev=51 --- libqt5-qtwebengine.changes | 6 ++ libqt5-qtwebengine.spec | 3 + python311-fixes.patch | 149 +++++++++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 python311-fixes.patch diff --git a/libqt5-qtwebengine.changes b/libqt5-qtwebengine.changes index f8a5be2..6a3d5a2 100644 --- a/libqt5-qtwebengine.changes +++ b/libqt5-qtwebengine.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 28 21:20:40 UTC 2023 - Dirk Müller + +- add python311-fixes.patch: + * Fix build when python3 is python 3.11+ + ------------------------------------------------------------------- Tue Apr 11 19:28:44 UTC 2023 - Christophe Marin diff --git a/libqt5-qtwebengine.spec b/libqt5-qtwebengine.spec index 62f2973..d1d9661 100644 --- a/libqt5-qtwebengine.spec +++ b/libqt5-qtwebengine.spec @@ -60,6 +60,8 @@ Patch5: qtwebengine-python3.patch Patch6: sandbox_futex_time64.patch # PATCH-FIX-UPSTREAM -- gcc13 fixes Patch7: 0001-Fixes-for-building-with-GCC-13.patch +# PATCH-FIX-UPSTREAM -- python 3.11 fixes +Patch8: python311-fixes.patch ### Patch 50-99 are applied conditionally # PATCH-FIX-OPENSUSE -- allow building qtwebengine with ffmpeg5 Patch50: qtwebengine-ffmpeg5.patch @@ -301,6 +303,7 @@ Examples for the libqt5-qtpdf module. %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 # Replace the whole catapult folder rather than picking individual changes pushd src/3rdparty/chromium/third_party diff --git a/python311-fixes.patch b/python311-fixes.patch new file mode 100644 index 0000000..d3edf87 --- /dev/null +++ b/python311-fixes.patch @@ -0,0 +1,149 @@ +From f90f49df8db04dcb72f7ce0c4d0b2fe329bab00c Mon Sep 17 00:00:00 2001 +From: Dan Harrington +Date: Fri, 04 Jun 2021 16:46:25 +0000 +Subject: [PATCH] Migrate presubmit to python3 + +Fixed a couple warnings I found when running the unit +tests in python3. + +Bug: 1212110 +Change-Id: I3d1b5859b5c517ad5eea30cb816fad0389715f73 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2934203 +Reviewed-by: Jesse Doherty +Commit-Queue: Dan H +Cr-Commit-Position: refs/heads/master@{#889331} +--- + +Index: qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/tools/metrics/ukm/PRESUBMIT.py +=================================================================== +--- qtwebengine-everywhere-src-5.15.13.orig/src/3rdparty/chromium/tools/metrics/ukm/PRESUBMIT.py ++++ qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/tools/metrics/ukm/PRESUBMIT.py +@@ -8,6 +8,8 @@ See http://dev.chromium.org/developers/h + for more details on the presubmit API built into gcl. + """ + ++USE_PYTHON3 = True ++ + UKM_XML = 'ukm.xml' + + +Index: qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/tools/metrics/ukm/gen_builders_test.py +=================================================================== +--- qtwebengine-everywhere-src-5.15.13.orig/src/3rdparty/chromium/tools/metrics/ukm/gen_builders_test.py ++++ qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/tools/metrics/ukm/gen_builders_test.py +@@ -25,8 +25,8 @@ class GenBuildersTest(unittest.TestCase) + + def testGenerateCode(self): + relpath = '.' +- data = ukm_model.UKM_XML_TYPE.Parse( +- open('../../tools/metrics/ukm/ukm.xml').read()) ++ with open('../../tools/metrics/ukm/ukm.xml') as f: ++ data = ukm_model.UKM_XML_TYPE.Parse(f.read()) + event = data[ukm_model._EVENT_TYPE.tag][0] + metric = event[ukm_model._METRIC_TYPE.tag][0] + self.assertIsNotNone(event) +Index: qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py +=================================================================== +--- qtwebengine-everywhere-src-5.15.13.orig/src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py ++++ qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py +@@ -39,15 +39,16 @@ _INDEX_TYPE = models.ObjectNodeType( + ], + single_line=True) + +-_STATISTICS_TYPE = models.ObjectNodeType( ++_STATISTICS_TYPE = models.ObjectNodeType( + 'statistics', + attributes=[ +- ('export', str, r'^(?i)(|true|false)$'), ++ ('export', str, r'(?i)^(|true|false)$'), + ], + children=[ + models.ChildType(_QUANTILES_TYPE.tag, _QUANTILES_TYPE, multiple=False), +- models.ChildType( +- _ENUMERATION_TYPE.tag, _ENUMERATION_TYPE, multiple=False), ++ models.ChildType(_ENUMERATION_TYPE.tag, ++ _ENUMERATION_TYPE, ++ multiple=False), + ]) + + _HISTORY_TYPE = models.ObjectNodeType( +@@ -90,25 +91,34 @@ _METRIC_TYPE = models.ObjectNodeType( + _AGGREGATION_TYPE.tag, _AGGREGATION_TYPE, multiple=True), + ]) + +-_EVENT_TYPE = models.ObjectNodeType( +- 'event', +- attributes=[ +- ('name', str, r'^[A-Za-z0-9.]+$'), +- ('singular', str, r'^(?i)(|true|false)$'), +- ], +- alphabetization=[ +- (_OBSOLETE_TYPE.tag, _KEEP_ORDER), +- (_OWNER_TYPE.tag, _KEEP_ORDER), +- (_SUMMARY_TYPE.tag, _KEEP_ORDER), +- (_METRIC_TYPE.tag, _LOWERCASE_FN('name')), +- ], +- extra_newlines=(1, 1, 1), +- children=[ +- models.ChildType(_OBSOLETE_TYPE.tag, _OBSOLETE_TYPE, multiple=False), +- models.ChildType(_OWNER_TYPE.tag, _OWNER_TYPE, multiple=True), +- models.ChildType(_SUMMARY_TYPE.tag, _SUMMARY_TYPE, multiple=False), +- models.ChildType(_METRIC_TYPE.tag, _METRIC_TYPE, multiple=True), +- ]) ++_EVENT_TYPE = models.ObjectNodeType('event', ++ attributes=[ ++ ('name', str, r'^[A-Za-z0-9.]+$'), ++ ('singular', str, ++ r'(?i)^(|true|false)$'), ++ ], ++ alphabetization=[ ++ (_OBSOLETE_TYPE.tag, _KEEP_ORDER), ++ (_OWNER_TYPE.tag, _KEEP_ORDER), ++ (_SUMMARY_TYPE.tag, _KEEP_ORDER), ++ (_METRIC_TYPE.tag, ++ _LOWERCASE_FN('name')), ++ ], ++ extra_newlines=(1, 1, 1), ++ children=[ ++ models.ChildType(_OBSOLETE_TYPE.tag, ++ _OBSOLETE_TYPE, ++ multiple=False), ++ models.ChildType(_OWNER_TYPE.tag, ++ _OWNER_TYPE, ++ multiple=True), ++ models.ChildType(_SUMMARY_TYPE.tag, ++ _SUMMARY_TYPE, ++ multiple=False), ++ models.ChildType(_METRIC_TYPE.tag, ++ _METRIC_TYPE, ++ multiple=True), ++ ]) + + _UKM_CONFIGURATION_TYPE = models.ObjectNodeType( + 'ukm-configuration', +Index: qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/PRESUBMIT_test_mocks.py +=================================================================== +--- qtwebengine-everywhere-src-5.15.13.orig/src/3rdparty/chromium/PRESUBMIT_test_mocks.py ++++ qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/PRESUBMIT_test_mocks.py +@@ -119,7 +119,7 @@ class MockInputApi(object): + def PresubmitLocalPath(self): + return self.presubmit_local_path + +- def ReadFile(self, filename, mode='rU'): ++ def ReadFile(self, filename, mode='r'): + if hasattr(filename, 'AbsoluteLocalPath'): + filename = filename.AbsoluteLocalPath() + for file_ in self.files: +Index: qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/tools/grit/grit/util.py +=================================================================== +--- qtwebengine-everywhere-src-5.15.13.orig/src/3rdparty/chromium/tools/grit/grit/util.py ++++ qtwebengine-everywhere-src-5.15.13/src/3rdparty/chromium/tools/grit/grit/util.py +@@ -211,7 +211,7 @@ def ReadFile(filename, encoding): + mode = 'rb' + encoding = None + else: +- mode = 'rU' ++ mode = 'r' + + with io.open(abs(filename), mode, encoding=encoding) as f: + return f.read()