commit:     c57fa9aac2b976ed3302c7c54310ccde0e7673e6
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  6 19:59:51 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Apr  6 21:33:24 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c57fa9aa

dev-qt/qtwebkit: Fix build with python-3.9

Thanks-to: Francesco Riosa <vivo75 <AT> gmail.com>
Closes: https://bugs.gentoo.org/766303
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../qtwebkit-5.212.0_pre20200309-python-3.9.patch  | 27 ++++++++++++++++++++++
 .../qtwebkit-5.212.0_pre20200309-r1.ebuild         |  3 ++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git 
a/dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-python-3.9.patch 
b/dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-python-3.9.patch
new file mode 100644
index 00000000000..a3b677b779b
--- /dev/null
+++ b/dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-python-3.9.patch
@@ -0,0 +1,27 @@
+From 78360c01c796b6260bf828bc9c8a0ef73c5132fd Mon Sep 17 00:00:00 2001
+From: Konstantin Tokarev <[email protected]>
+Date: Wed, 3 Jun 2020 15:01:42 +0300
+Subject: [PATCH] Fix compilation with Python 3.9: avoid passing encoding to
+ json.load()
+
+In Python 2.7 UTF-8 is assumed by default, while in Python 3 this argument
+is not supported.
+
+Change-Id: Ic459d60a6b20bc1838d8771bc36ac41614fe61a9
+---
+ Source/JavaScriptCore/generate-bytecode-files | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/JavaScriptCore/generate-bytecode-files 
b/Source/JavaScriptCore/generate-bytecode-files
+index c5dab429c7b0..af3431275ecf 100644
+--- a/Source/JavaScriptCore/generate-bytecode-files
++++ b/Source/JavaScriptCore/generate-bytecode-files
+@@ -163,7 +163,7 @@ if __name__ == "__main__":
+         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/dev-qt/qtwebkit/qtwebkit-5.212.0_pre20200309-r1.ebuild 
b/dev-qt/qtwebkit/qtwebkit-5.212.0_pre20200309-r1.ebuild
index d6744c8a405..62ebc6f09e8 100644
--- a/dev-qt/qtwebkit/qtwebkit-5.212.0_pre20200309-r1.ebuild
+++ b/dev-qt/qtwebkit/qtwebkit-5.212.0_pre20200309-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -86,6 +86,7 @@ CHECKREQS_DISK_BUILD="16G" # bug 417307
 PATCHES=(
        "${FILESDIR}/${P}-bison-3.7.patch" # bug 736499
        "${FILESDIR}/${P}-icu-68.patch" # bug 753260
+       "${FILESDIR}/${P}-python-3.9.patch" # bug 766303
 )
 
 _check_reqs() {

Reply via email to