summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2023-05-17 08:20:19 +0200
committerArmin Kuster <akuster808@gmail.com>2023-06-23 06:58:18 -0400
commitd25f2f1cacecf60397e3d5fa913b4b771e1ba8a0 (patch)
tree27ffc64d90132503cf455ee60ea48edd1215c345
parent116bfe8d5e5851e7fc5424f40da8691a19c5b5ee (diff)
downloadmeta-openembedded-d25f2f1cacecf60397e3d5fa913b4b771e1ba8a0.tar.gz
nodejs: fix native node-gyp to work 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-devtools/nodejs/nodejs/python-3.11-invalid-mode-rU.patch46
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs_12.22.12.bb1
2 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/python-3.11-invalid-mode-rU.patch b/meta-oe/recipes-devtools/nodejs/nodejs/python-3.11-invalid-mode-rU.patch
new file mode 100644
index 0000000000..588ffc1eee
--- /dev/null
+++ b/meta-oe/recipes-devtools/nodejs/nodejs/python-3.11-invalid-mode-rU.patch
@@ -0,0 +1,46 @@
1From e4d6f2e4091a4c7b6f3281be0e281b32ee6e5a33 Mon Sep 17 00:00:00 2001
2From: Christian Clauss <cclauss@me.com>
3Date: Thu, 26 Nov 2020 12:39:11 +0100
4Subject: [PATCH] Fix ValueError: invalid mode: 'rU' while trying to load
5 binding.gyp
6
7Fixes nodejs/node-gyp#2219
8File mode `U` is deprecated in Python 3 https://docs.python.org/3/library/functions.html#open
9https://github.com/asottile/pyupgrade#redundant-open-modes
10
11Upstream-Status: Backport [https://github.com/nodejs/gyp-next/commit/3f8cb33ea4d191df41f4fb7a1dfbd302507f7260]
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13---
14 deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 2 +-
15 tools/gyp/pylib/gyp/input.py | 2 +-
16 2 files changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
19index d174280..2f34bc0 100644
20--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
21+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
22@@ -226,7 +226,7 @@ def LoadOneBuildFile(build_file_path, data, aux_data, includes,
23 # Open the build file for read ('r') with universal-newlines mode ('U')
24 # to make sure platform specific newlines ('\r\n' or '\r') are converted to '\n'
25 # which otherwise will fail eval()
26- if sys.platform == 'zos':
27+ if PY3 or sys.platform == 'zos':
28 # On z/OS, universal-newlines mode treats the file as an ascii file. But since
29 # node-gyp produces ebcdic files, do not use that mode.
30 build_file_contents = open(build_file_path, 'r').read()
31diff --git a/tools/gyp/pylib/gyp/input.py b/tools/gyp/pylib/gyp/input.py
32index 1f40abb..fd12e78 100644
33--- a/tools/gyp/pylib/gyp/input.py
34+++ b/tools/gyp/pylib/gyp/input.py
35@@ -226,7 +226,7 @@ def LoadOneBuildFile(build_file_path, data, aux_data, includes,
36 # Open the build file for read ('r') with universal-newlines mode ('U')
37 # to make sure platform specific newlines ('\r\n' or '\r') are converted to '\n'
38 # which otherwise will fail eval()
39- if sys.platform == 'zos':
40+ if PY3 or sys.platform == 'zos':
41 # On z/OS, universal-newlines mode treats the file as an ascii file. But since
42 # node-gyp produces ebcdic files, do not use that mode.
43 build_file_contents = open(build_file_path, 'r').read()
44--
452.38.1
46
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_12.22.12.bb b/meta-oe/recipes-devtools/nodejs/nodejs_12.22.12.bb
index 3ededae562..c1d66eeffb 100644
--- a/meta-oe/recipes-devtools/nodejs/nodejs_12.22.12.bb
+++ b/meta-oe/recipes-devtools/nodejs/nodejs_12.22.12.bb
@@ -26,6 +26,7 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
26 file://CVE-2022-35255.patch \ 26 file://CVE-2022-35255.patch \
27 file://CVE-2022-43548.patch \ 27 file://CVE-2022-43548.patch \
28 file://CVE-llhttp.patch \ 28 file://CVE-llhttp.patch \
29 file://python-3.11-invalid-mode-rU.patch \
29 " 30 "
30SRC_URI_append_class-target = " \ 31SRC_URI_append_class-target = " \
31 file://0002-Using-native-binaries.patch \ 32 file://0002-Using-native-binaries.patch \