diff --git a/mingw-w64-qtwebkit/0006-python-output-unix-line-endings.patch b/mingw-w64-qtwebkit/0006-python-output-unix-line-endings.patch index 8fb47f0309..b3c733913a 100644 --- a/mingw-w64-qtwebkit/0006-python-output-unix-line-endings.patch +++ b/mingw-w64-qtwebkit/0006-python-output-unix-line-endings.patch @@ -1,33 +1,139 @@ ---- qtwebkit-tp5/Source/WebCore/platform/network/create-http-header-name-table.orig 2017-02-07 23:28:00.520278300 +0300 -+++ qtwebkit-tp5/Source/WebCore/platform/network/create-http-header-name-table 2017-02-07 23:29:15.412561900 +0300 -@@ -54,7 +55,7 @@ +--- qtwebkit-5.212.0-alpha4/Source/WebCore/platform/network/create-http-header-name-table.orig 2020-03-04 09:16:37.000000000 -0800 ++++ qtwebkit-5.212.0-alpha4/Source/WebCore/platform/network/create-http-header-name-table 2021-08-18 16:37:29.705107300 -0700 +@@ -54,8 +54,8 @@ http_header_names.sort() -gperf_file = open('HTTPHeaderNames.gperf', 'w') +-gperf_file.write(''' +gperf_file = open('HTTPHeaderNames.gperf', 'wb') - gperf_file.write(''' ++gperf_file.write(b''' %{ /* ---- qtwebkit-tp5/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py.orig 2017-02-08 00:23:27.256556700 +0300 -+++ qtwebkit-tp5/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py 2017-02-08 00:23:33.040887600 +0300 -@@ -57,7 +57,7 @@ + * Copyright (C) 2014 Apple Inc. All rights reserved. +@@ -105,11 +105,11 @@ + ''') + + for http_header_name in http_header_names: +- gperf_file.write(' { "%s", %u },\n' % (http_header_name, len(http_header_name))) ++ gperf_file.write((' { "%s", %u },\n' % (http_header_name, len(http_header_name))).encode('ascii')) + +-gperf_file.write('};\n\n') ++gperf_file.write(b'};\n\n') + +-gperf_file.write(''' ++gperf_file.write(b''' + %} + + %language=C++ +@@ -131,9 +131,9 @@ + ''') + + for http_header_name in http_header_names: +- gperf_file.write('%s, HTTPHeaderName::%s\n' % (http_header_name, http_header_name_to_id[http_header_name])) ++ gperf_file.write(('%s, HTTPHeaderName::%s\n' % (http_header_name, http_header_name_to_id[http_header_name])).encode('ascii')) + +-gperf_file.write('''%% ++gperf_file.write(b'''%% + bool findHTTPHeaderName(StringView stringView, HTTPHeaderName& headerName) + { + unsigned length = stringView.length(); +--- qtwebkit-5.212.0-alpha4/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py.orig 2020-03-04 09:16:37.000000000 -0800 ++++ qtwebkit-5.212.0-alpha4/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py 2021-08-18 16:40:37.434628000 -0700 +@@ -57,9 +57,9 @@ def expand_ifdef_condition(condition): return condition.replace('(', '_').replace(')', '') -output_file = open('SelectorPseudoClassAndCompatibilityElementMap.gperf', 'w') +output_file = open('SelectorPseudoClassAndCompatibilityElementMap.gperf', 'wb') - output_file.write(""" +-output_file.write(""" ++output_file.write(b""" %{ ---- qtwebkit-tp5/Source/WebCore/css/makeSelectorPseudoElementsMap.py.orig 2017-02-08 00:23:46.797674400 +0300 -+++ qtwebkit-tp5/Source/WebCore/css/makeSelectorPseudoElementsMap.py 2017-02-08 00:23:51.732956700 +0300 -@@ -57,7 +57,7 @@ + /* + * Copyright (C) 2014 Apple Inc. All rights reserved. +@@ -151,20 +151,20 @@ + keyword_definition = line.split(',') + if len(keyword_definition) == 1: + keyword = keyword_definition[0].strip() +- output_file.write('"%s", {%s, CSSSelector::PseudoElementUnknown}\n' % (keyword, enumerablePseudoType(keyword))) ++ output_file.write(('"%s", {%s, CSSSelector::PseudoElementUnknown}\n' % (keyword, enumerablePseudoType(keyword))).encode('ascii')) + else: +- output_file.write('"%s", {CSSSelector::%s, CSSSelector::%s}\n' % (keyword_definition[0].strip(), keyword_definition[1].strip(), keyword_definition[2].strip())) ++ output_file.write(('"%s", {CSSSelector::%s, CSSSelector::%s}\n' % (keyword_definition[0].strip(), keyword_definition[1].strip(), keyword_definition[2].strip())).encode('ascii')) + + longest_keyword = max(longest_keyword, len(keyword)) + +-output_file.write("""%% ++output_file.write(b"""%% + + static inline const SelectorPseudoClassOrCompatibilityPseudoElementEntry* parsePseudoClassAndCompatibilityElementString(const LChar* characters, unsigned length) + { + return SelectorPseudoClassAndCompatibilityElementMapHash::in_word_set(reinterpret_cast(characters), length); + }""") + +-output_file.write(""" ++output_file.write((""" + + static inline const SelectorPseudoClassOrCompatibilityPseudoElementEntry* parsePseudoClassAndCompatibilityElementString(const UChar* characters, unsigned length) + { +@@ -182,9 +182,9 @@ + } + return parsePseudoClassAndCompatibilityElementString(buffer, length); + } +-""" % longest_keyword) ++""" % longest_keyword).encode('ascii')) + +-output_file.write(""" ++output_file.write(b""" + PseudoClassOrCompatibilityPseudoElement parsePseudoClassAndCompatibilityElementString(const CSSParserString& pseudoTypeString) + { + const SelectorPseudoClassOrCompatibilityPseudoElementEntry* entry; +--- qtwebkit-5.212.0-alpha4/Source/WebCore/css/makeSelectorPseudoElementsMap.py.orig 2020-03-04 09:16:37.000000000 -0800 ++++ qtwebkit-5.212.0-alpha4/Source/WebCore/css/makeSelectorPseudoElementsMap.py 2021-08-18 16:41:25.974582300 -0700 +@@ -57,9 +57,9 @@ def expand_ifdef_condition(condition): return condition.replace('(', '_').replace(')', '') -output_file = open('SelectorPseudoElementTypeMap.gperf', 'w') +output_file = open('SelectorPseudoElementTypeMap.gperf', 'wb') - output_file.write(""" +-output_file.write(""" ++output_file.write(b""" %{ + /* + * Copyright (C) 2014 Apple Inc. All rights reserved. +@@ -153,10 +153,10 @@ + keyword = keyword_definition[0].strip() + pseudo_element_enum_value = "CSSSelector::" + keyword_definition[1].strip() + +- output_file.write('"%s", %s\n' % (keyword, pseudo_element_enum_value)) ++ output_file.write(('"%s", %s\n' % (keyword, pseudo_element_enum_value)).encode('ascii')) + longest_keyword = max(longest_keyword, len(keyword)) + +-output_file.write("""%% ++output_file.write(b"""%% + + static inline CSSSelector::PseudoElementType parsePseudoElementString(const LChar* characters, unsigned length) + { +@@ -165,7 +165,7 @@ + return CSSSelector::PseudoElementUnknown; + }""") + +-output_file.write(""" ++output_file.write((""" + + static inline CSSSelector::PseudoElementType parsePseudoElementString(const UChar* characters, unsigned length) + { +@@ -183,9 +183,9 @@ + } + return parsePseudoElementString(buffer, length); + } +-""" % longest_keyword) ++""" % longest_keyword).encode('ascii')) + +-output_file.write(""" ++output_file.write(b""" + CSSSelector::PseudoElementType parsePseudoElementString(const StringImpl& pseudoTypeString) + { + if (pseudoTypeString.is8Bit()) diff --git a/mingw-w64-qtwebkit/0503-python3.patch b/mingw-w64-qtwebkit/0503-python3.patch new file mode 100644 index 0000000000..1c0a9699f6 --- /dev/null +++ b/mingw-w64-qtwebkit/0503-python3.patch @@ -0,0 +1,11 @@ +--- qtwebkit-5.212.0-alpha4/Source/JavaScriptCore/generate-bytecode-files.bak 2021-08-18 14:51:40.575486700 -0700 ++++ qtwebkit-5.212.0-alpha4/Source/JavaScriptCore/generate-bytecode-files 2021-08-18 14:53:56.356751200 -0700 +@@ -163,7 +163,7 @@ + initBytecodesFile = openOrExit(initASMFileName, "w") + + try: +- bytecodeSections = json.load(bytecodeFile, encoding = "utf-8") ++ bytecodeSections = json.load(bytecodeFile) + except: + print("Unexpected error parsing {0}: {1}".format(bytecodeJSONFile, sys.exc_info())) + diff --git a/mingw-w64-qtwebkit/PKGBUILD b/mingw-w64-qtwebkit/PKGBUILD index adc26ad994..e1fef7c00f 100644 --- a/mingw-w64-qtwebkit/PKGBUILD +++ b/mingw-w64-qtwebkit/PKGBUILD @@ -46,11 +46,12 @@ source=(https://github.com/annulen/webkit/releases/download/qtwebkit-${_pkgver}/ 0300-fix-generating-module-files.patch 0501-build-gcc9.patch 0502-clang-compat.patch + 0503-python3.patch d92b11fea65364fefa700249bd3340e0cd4c5b31.patch) sha256sums=('9ca126da9273664dd23a3ccd0c9bebceb7bb534bddd743db31caf6a5a6d4a9e6' 'ed80d9a31cb1f9565841e3e206d76810881b7fce30210022270bd19694a9c906' 'b9e39597d140f3fc40d07ae0f0eea0cbabd7b16d8e430d26445ae3063b8ad055' - '16410ad976524b40e7b9d906e67e4f46b86b58db6d7bb61e929f500387d7937f' + '02d0eb76207c4c2d36a50291976f8cc141fcff030c4b77c399402cd10a789b99' '9ef33dc05e5652362e10d34d75fd2cf9e7952c1c99306eb2402367401f86770b' 'a1ef305a81b4e1b70290d4c3f70bee545f06c17736fe77abde474dba0df8c5c7' 'c39b65235a61217bf4197285d21765a47a91d2e8c267f4b777c982d56d32b408' @@ -61,6 +62,7 @@ sha256sums=('9ca126da9273664dd23a3ccd0c9bebceb7bb534bddd743db31caf6a5a6d4a9e6' '5ab5de5ee65fcd2a00412c8a2a1b2bbc4281d4ad99bac743757e6e8199a75ebe' 'f6e85179e3581456cdfa9a00af537b4fb3caf0d66b14becc6592a15deba11175' '17bfe3bf5dde380b16198d9f63c7f74032c1fa7e8530047625f0f413d365a722' + 'e0f0f5bb122f0473e650855c5d0dd26ea1a9da8ccbd74184a328c75a7f9e6081' 'cc5a2b762426e9cda5a3ae056bba266b5f775ee75c0590913839c255d5f10db0') # Helper macros to help make tasks easier # @@ -93,7 +95,8 @@ prepare() { apply_patch_with_msg \ 0300-fix-generating-module-files.patch \ 0501-build-gcc9.patch \ - 0502-clang-compat.patch + 0502-clang-compat.patch \ + 0503-python3.patch # Fix build with bison 3.7+ apply_patch_with_msg \