0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-10-03 06:49:41 +00:00
Files
termux-packages/x11-packages/qt5-qtwebengine/0031-fix-six-for-python-312.patch
Robert Kirkman 4dd604d32b bump(x11/qt5-qtwebengine): 5.15.18 (#23146)
- fix build with clang 18
- fix build with python 3.12
- fix build for 32-bit ARM (add `libopus` to dependencies explicitly,
  which prevents this error)

```
FAILED: gen/third_party/opus/celt_pitch_xcorr_arm_gnu.S
/usr/bin/python3 ../../../../src/src/3rdparty/chromium/third_party/opus/convert_rtcd_assembler.py ../../../../src/src/3rdparty/chromium/third_party/opus/src/celt/arm/arm2gnu.pl ../../../../src/src/3rdparty/chromium/third_party/opus/src/celt/arm/celt_pitch_xcorr_arm.s gen/third_party/opus/celt_pitch_xcorr_arm_gnu.S
  File "/home/builder/.termux-build/qt5-qtwebengine/build/src/core/release/../../../../src/src/3rdparty/chromium/third_party/opus/convert_rtcd_assembler.py", line 23
    print USAGE
    ^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
```
2025-02-10 20:06:57 +08:00

58 lines
1.7 KiB
Diff

Patch from Arch Linux: https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/blob/ee7fd7639a1ab69fc9b1eeff3dabdb52c8bd231f/python3.12-six.patch
Cherry-pick from https://github.com/benjaminp/six/commit/25916292d96f5f09
--- 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]