diff options
3 files changed, 121 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-build-fix-build-with-Python-3.12.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-build-fix-build-with-Python-3.12.patch new file mode 100644 index 0000000000..39026d0742 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs/0001-build-fix-build-with-Python-3.12.patch | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | From 656f6c91f1da7f1e1ffb01e2de7d9026a84958b5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Luigi Pinca <luigipinca@gmail.com> | ||
| 3 | Date: Wed, 8 Nov 2023 21:20:53 +0100 | ||
| 4 | Subject: [PATCH] build: fix build with Python 3.12 | ||
| 5 | |||
| 6 | Replace `distutils.version.StrictVersion` with | ||
| 7 | `packaging.version.Version`. | ||
| 8 | |||
| 9 | Refs: https://github.com/nodejs/node/pull/50209#issuecomment-1795852539 | ||
| 10 | PR-URL: https://github.com/nodejs/node/pull/50582 | ||
| 11 | Reviewed-By: Richard Lau <rlau@redhat.com> | ||
| 12 | Reviewed-By: Chengzhong Wu <legendecas@gmail.com> | ||
| 13 | |||
| 14 | Upstream-Status: Backport [https://github.com/nodejs/node/commit/95534ad82f4e33f53fd50efe633d43f8da70cba6] | ||
| 15 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
| 16 | --- | ||
| 17 | configure.py | 11 +++++------ | ||
| 18 | 1 file changed, 5 insertions(+), 6 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/configure.py b/configure.py | ||
| 21 | index 62f041ce..18fe7c14 100755 | ||
| 22 | --- a/configure.py | ||
| 23 | +++ b/configure.py | ||
| 24 | @@ -14,8 +14,6 @@ import bz2 | ||
| 25 | import io | ||
| 26 | from pathlib import Path | ||
| 27 | |||
| 28 | -from distutils.version import StrictVersion | ||
| 29 | - | ||
| 30 | # If not run from node/, cd to node/. | ||
| 31 | os.chdir(Path(__file__).parent) | ||
| 32 | |||
| 33 | @@ -30,6 +28,7 @@ tools_path = Path('tools') | ||
| 34 | |||
| 35 | sys.path.insert(0, str(tools_path / 'gyp' / 'pylib')) | ||
| 36 | from gyp.common import GetFlavor | ||
| 37 | +from packaging.version import Version | ||
| 38 | |||
| 39 | # imports in tools/configure.d | ||
| 40 | sys.path.insert(0, str(tools_path / 'configure.d')) | ||
| 41 | @@ -1565,10 +1564,10 @@ def configure_openssl(o): | ||
| 42 | # supported asm compiler for AVX2. See https://github.com/openssl/openssl/ | ||
| 43 | # blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69 | ||
| 44 | openssl110_asm_supported = \ | ||
| 45 | - ('gas_version' in variables and StrictVersion(variables['gas_version']) >= StrictVersion('2.23')) or \ | ||
| 46 | - ('xcode_version' in variables and StrictVersion(variables['xcode_version']) >= StrictVersion('5.0')) or \ | ||
| 47 | - ('llvm_version' in variables and StrictVersion(variables['llvm_version']) >= StrictVersion('3.3')) or \ | ||
| 48 | - ('nasm_version' in variables and StrictVersion(variables['nasm_version']) >= StrictVersion('2.10')) | ||
| 49 | + ('gas_version' in variables and Version(variables['gas_version']) >= Version('2.23')) or \ | ||
| 50 | + ('xcode_version' in variables and Version(variables['xcode_version']) >= Version('5.0')) or \ | ||
| 51 | + ('llvm_version' in variables and Version(variables['llvm_version']) >= Version('3.3')) or \ | ||
| 52 | + ('nasm_version' in variables and Version(variables['nasm_version']) >= Version('2.10')) | ||
| 53 | |||
| 54 | if is_x86 and not openssl110_asm_supported: | ||
| 55 | error('''Did not find a new enough assembler, install one or build with | ||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-gyp-resolve-python-3.12-issues.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-gyp-resolve-python-3.12-issues.patch new file mode 100644 index 0000000000..9d878dfb8d --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs/0001-gyp-resolve-python-3.12-issues.patch | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | From bf8c96ba6936050ed4a0de5bc8aeeaf2b3c50dc1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kanavin <alex@linutronix.de> | ||
| 3 | Date: Thu, 7 Dec 2023 12:54:30 +0100 | ||
| 4 | Subject: [PATCH] gyp: resolve python 3.12 issues | ||
| 5 | |||
| 6 | Upstream has updated gyp wholesale in the main branch, so | ||
| 7 | this patch can be dropped in due time. | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [issue will be fixed upstream with the next nodejs LTS update] | ||
| 10 | |||
| 11 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
| 12 | --- | ||
| 13 | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 4 ++-- | ||
| 14 | tools/gyp/pylib/gyp/input.py | 4 ++-- | ||
| 15 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
| 16 | |||
| 17 | diff --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 | ||
| 18 | index d9699a0a..173e9465 100644 | ||
| 19 | --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | ||
| 20 | +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | ||
| 21 | @@ -16,7 +16,7 @@ import subprocess | ||
| 22 | import sys | ||
| 23 | import threading | ||
| 24 | import traceback | ||
| 25 | -from distutils.version import StrictVersion | ||
| 26 | +from packaging.version import Version | ||
| 27 | from gyp.common import GypError | ||
| 28 | from gyp.common import OrderedSet | ||
| 29 | |||
| 30 | @@ -1183,7 +1183,7 @@ def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, buil | ||
| 31 | else: | ||
| 32 | ast_code = compile(cond_expr_expanded, "<string>", "eval") | ||
| 33 | cached_conditions_asts[cond_expr_expanded] = ast_code | ||
| 34 | - env = {"__builtins__": {}, "v": StrictVersion} | ||
| 35 | + env = {"__builtins__": {}, "v": Version} | ||
| 36 | if eval(ast_code, env, variables): | ||
| 37 | return true_dict | ||
| 38 | return false_dict | ||
| 39 | diff --git a/tools/gyp/pylib/gyp/input.py b/tools/gyp/pylib/gyp/input.py | ||
| 40 | index 354958bf..ab6112e5 100644 | ||
| 41 | --- a/tools/gyp/pylib/gyp/input.py | ||
| 42 | +++ b/tools/gyp/pylib/gyp/input.py | ||
| 43 | @@ -16,7 +16,7 @@ import subprocess | ||
| 44 | import sys | ||
| 45 | import threading | ||
| 46 | import traceback | ||
| 47 | -from distutils.version import StrictVersion | ||
| 48 | +from packaging.version import Version | ||
| 49 | from gyp.common import GypError | ||
| 50 | from gyp.common import OrderedSet | ||
| 51 | |||
| 52 | @@ -1190,7 +1190,7 @@ def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, buil | ||
| 53 | else: | ||
| 54 | ast_code = compile(cond_expr_expanded, "<string>", "eval") | ||
| 55 | cached_conditions_asts[cond_expr_expanded] = ast_code | ||
| 56 | - env = {"__builtins__": {}, "v": StrictVersion} | ||
| 57 | + env = {"__builtins__": {}, "v": Version} | ||
| 58 | if eval(ast_code, env, variables): | ||
| 59 | return true_dict | ||
| 60 | return false_dict | ||
| 61 | -- | ||
| 62 | 2.39.2 | ||
| 63 | |||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb b/meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb index 65f4eb3f3a..0ca0c1498a 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb | |||
| @@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=162595a4a2f3453a0534e60b0afe4e7b" | |||
| 5 | 5 | ||
| 6 | CVE_PRODUCT = "nodejs node.js" | 6 | CVE_PRODUCT = "nodejs node.js" |
| 7 | 7 | ||
| 8 | DEPENDS = "openssl file-replacement-native" | 8 | DEPENDS = "openssl file-replacement-native python3-packaging-native" |
| 9 | DEPENDS:append:class-target = " qemu-native" | 9 | DEPENDS:append:class-target = " qemu-native" |
| 10 | DEPENDS:append:class-native = " c-ares-native" | 10 | DEPENDS:append:class-native = " c-ares-native" |
| 11 | 11 | ||
| @@ -27,6 +27,8 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | |||
| 27 | file://0001-Revert-io_uring-changes-from-libuv-1.46.0.patch \ | 27 | file://0001-Revert-io_uring-changes-from-libuv-1.46.0.patch \ |
| 28 | file://0002-Revert-io_uring-changes-from-libuv-1.45.0.patch \ | 28 | file://0002-Revert-io_uring-changes-from-libuv-1.45.0.patch \ |
| 29 | file://run-ptest \ | 29 | file://run-ptest \ |
| 30 | file://0001-build-fix-build-with-Python-3.12.patch \ | ||
| 31 | file://0001-gyp-resolve-python-3.12-issues.patch \ | ||
| 30 | " | 32 | " |
| 31 | 33 | ||
| 32 | SRC_URI:append:class-target = " \ | 34 | SRC_URI:append:class-target = " \ |
