diff options
| author | Martin Jansa <Martin.Jansa@gmail.com> | 2023-11-06 19:41:56 +0100 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2023-11-12 10:42:03 -0500 |
| commit | 9135c7ea7350d5d241f4afc3b28087122ebe2d19 (patch) | |
| tree | 9c4c90085c9db60c26d9b29f9bb780678397d638 | |
| parent | 026fcadc2e2a270e0942554dea785f4ecf1c5959 (diff) | |
| download | meta-openembedded-9135c7ea7350d5d241f4afc3b28087122ebe2d19.tar.gz | |
glmark2: fix compatibility with python-3.11
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | meta-oe/recipes-benchmark/glmark2/files/0001-waflib-fix-compatibility-with-python-3.11.patch | 76 | ||||
| -rw-r--r-- | meta-oe/recipes-benchmark/glmark2/glmark2_git.bb | 5 |
2 files changed, 79 insertions, 2 deletions
diff --git a/meta-oe/recipes-benchmark/glmark2/files/0001-waflib-fix-compatibility-with-python-3.11.patch b/meta-oe/recipes-benchmark/glmark2/files/0001-waflib-fix-compatibility-with-python-3.11.patch new file mode 100644 index 0000000000..c56fa64e58 --- /dev/null +++ b/meta-oe/recipes-benchmark/glmark2/files/0001-waflib-fix-compatibility-with-python-3.11.patch | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | From b85ba8c3ff3fb9ae708576ccef03434d2ef73054 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 3 | Date: Tue, 14 Jun 2022 09:54:18 +0000 | ||
| 4 | Subject: [PATCH] waflib: fix compatibility with python-3.11 | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | * https://docs.python.org/3.11/whatsnew/3.11.html#changes-in-the-python-api | ||
| 10 | |||
| 11 | open(), io.open(), codecs.open() and fileinput.FileInput no longer | ||
| 12 | accept 'U' (“universal newline”) in the file mode. This flag was | ||
| 13 | deprecated since Python 3.3. In Python 3, the “universal newline” is | ||
| 14 | used by default when a file is open in text mode. The newline parameter | ||
| 15 | of open() controls how universal newlines works. (Contributed by Victor | ||
| 16 | Stinner in bpo-37330.) | ||
| 17 | |||
| 18 | * fixes: | ||
| 19 | Waf: The wscript in '/OE/build/luneos-langdale/webos-ports/tmp-glibc/work/core2-64-webos-linux/glmark2/2021.12-r0/git' is unreadable | ||
| 20 | Traceback (most recent call last): | ||
| 21 | File "/OE/build/luneos-langdale/webos-ports/tmp-glibc/work/core2-64-webos-linux/glmark2/2021.12-r0/git/waflib/Scripting.py", line 104, in waf_entry_point | ||
| 22 | set_main_module(os.path.normpath(os.path.join(Context.run_dir,Context.WSCRIPT_FILE))) | ||
| 23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 24 | File "/OE/build/luneos-langdale/webos-ports/tmp-glibc/work/core2-64-webos-linux/glmark2/2021.12-r0/git/waflib/Scripting.py", line 135, in set_main_module | ||
| 25 | Context.g_module=Context.load_module(file_path) | ||
| 26 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 27 | File "/OE/build/luneos-langdale/webos-ports/tmp-glibc/work/core2-64-webos-linux/glmark2/2021.12-r0/git/waflib/Context.py", line 343, in load_module | ||
| 28 | code=Utils.readf(path,m='rU',encoding=encoding) | ||
| 29 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 30 | File "/OE/build/luneos-langdale/webos-ports/tmp-glibc/work/core2-64-webos-linux/glmark2/2021.12-r0/git/waflib/Utils.py", line 117, in readf | ||
| 31 | f=open(fname,m) | ||
| 32 | ^^^^^^^^^^^^^ | ||
| 33 | ValueError: invalid mode: 'rUb' | ||
| 34 | |||
| 35 | Upstream-Status: Submitted [https://github.com/glmark2/glmark2/pull/178] | ||
| 36 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
| 37 | --- | ||
| 38 | waflib/ConfigSet.py | 2 +- | ||
| 39 | waflib/Context.py | 4 ++-- | ||
| 40 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
| 41 | |||
| 42 | diff --git a/waflib/ConfigSet.py b/waflib/ConfigSet.py | ||
| 43 | index 16142a2..87de4ad 100644 | ||
| 44 | --- a/waflib/ConfigSet.py | ||
| 45 | +++ b/waflib/ConfigSet.py | ||
| 46 | @@ -140,7 +140,7 @@ class ConfigSet(object): | ||
| 47 | Utils.writef(filename,''.join(buf)) | ||
| 48 | def load(self,filename): | ||
| 49 | tbl=self.table | ||
| 50 | - code=Utils.readf(filename,m='rU') | ||
| 51 | + code=Utils.readf(filename,m='r') | ||
| 52 | for m in re_imp.finditer(code): | ||
| 53 | g=m.group | ||
| 54 | tbl[g(2)]=eval(g(3)) | ||
| 55 | diff --git a/waflib/Context.py b/waflib/Context.py | ||
| 56 | index 8f2cbfb..f3e35ae 100644 | ||
| 57 | --- a/waflib/Context.py | ||
| 58 | +++ b/waflib/Context.py | ||
| 59 | @@ -109,7 +109,7 @@ class Context(ctx): | ||
| 60 | cache[node]=True | ||
| 61 | self.pre_recurse(node) | ||
| 62 | try: | ||
| 63 | - function_code=node.read('rU',encoding) | ||
| 64 | + function_code=node.read('r',encoding) | ||
| 65 | exec(compile(function_code,node.abspath(),'exec'),self.exec_dict) | ||
| 66 | finally: | ||
| 67 | self.post_recurse(node) | ||
| 68 | @@ -340,7 +340,7 @@ def load_module(path,encoding=None): | ||
| 69 | pass | ||
| 70 | module=imp.new_module(WSCRIPT_FILE) | ||
| 71 | try: | ||
| 72 | - code=Utils.readf(path,m='rU',encoding=encoding) | ||
| 73 | + code=Utils.readf(path,encoding=encoding) | ||
| 74 | except EnvironmentError: | ||
| 75 | raise Errors.WafError('Could not read the file %r'%path) | ||
| 76 | module_dir=os.path.dirname(path) | ||
diff --git a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb index 4976bf6905..2b2ff53c7e 100644 --- a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb +++ b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb | |||
| @@ -15,9 +15,10 @@ PV = "20191226+${SRCPV}" | |||
| 15 | COMPATIBLE_HOST_rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '.*-linux*', 'null', d)}" | 15 | COMPATIBLE_HOST_rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '.*-linux*', 'null', d)}" |
| 16 | 16 | ||
| 17 | SRC_URI = "git://github.com/glmark2/glmark2.git;protocol=https;branch=master \ | 17 | SRC_URI = "git://github.com/glmark2/glmark2.git;protocol=https;branch=master \ |
| 18 | file://python3.patch" | 18 | file://python3.patch \ |
| 19 | file://0001-waflib-fix-compatibility-with-python-3.11.patch \ | ||
| 20 | " | ||
| 19 | SRCREV = "72dabc5d72b49c6d45badeb8a941ba4d829b0bd6" | 21 | SRCREV = "72dabc5d72b49c6d45badeb8a941ba4d829b0bd6" |
| 20 | |||
| 21 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |
| 22 | 23 | ||
| 23 | inherit waf pkgconfig features_check | 24 | inherit waf pkgconfig features_check |
