Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
056405bc90
!16 Fix load error for nodejs-20.x
From: @wk333 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
2024-01-02 02:37:35 +00:00
wk333
61deaedc0a Fix load error for nodejs-20.x 2024-01-02 10:23:56 +08:00
openeuler-ci-bot
92a4e354c6
!15 fix addon test for Node.js 12 and V8 7.4
From: @cherry530 
Reviewed-by: @wang--ge 
Signed-off-by: @wang--ge
2023-02-10 09:21:46 +00:00
cherry530
23f9e1fb63 fix test error
Signed-off-by: cherry530 <xuping33@huawei.com>
2023-02-10 17:11:21 +08:00
openeuler-ci-bot
c7d7076692
!13 Remove test-download
From: @wk333 
Reviewed-by: @gitee-cmd 
Signed-off-by: @gitee-cmd
2022-07-05 11:51:27 +00:00
wk333
3743c31713 Remove test-download 2022-07-05 18:59:10 +08:00
openeuler-ci-bot
cd947f45ca !5 Limit npm(nan) version to fix test errors
From: @ultra_planet
Reviewed-by: @zhengyuhanghans
Signed-off-by: @zhengyuhanghans
2021-01-22 17:24:46 +08:00
lingsheng
24a1c443aa Limit npm(nan) version to fix test errors 2021-01-21 19:14:04 +08:00
openeuler-ci-bot
50990ca442 !4 fix test errors in node 12+
From: @hht8
Reviewed-by: @zhengyuhanghans
Signed-off-by: @zhengyuhanghans
2020-12-31 11:01:42 +08:00
hht8
fc11bb8d51 fix test errors in node 12+ 2020-12-29 15:55:25 +08:00
3 changed files with 76 additions and 3 deletions

View File

@ -0,0 +1,35 @@
From e6699d13cdcd6abe543b250f4297808912a4a188 Mon Sep 17 00:00:00 2001
From: Richard Lau <riclau@uk.ibm.com>
Date: Tue, 2 Apr 2019 19:42:13 +0100
Subject: [PATCH] test: fix addon test for Node.js 12 and V8 7.4
V8 7.4 removes some API functions. Replace those with their NAN
counterparts.
PR-URL: https://github.com/nodejs/node-gyp/pull/1705
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
---
test/node_modules/hello_world/hello.cc | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/test/node_modules/hello_world/hello.cc b/test/node_modules/hello_world/hello.cc
index 89bfd7ac04..ea724e896c 100644
--- a/test/node_modules/hello_world/hello.cc
+++ b/test/node_modules/hello_world/hello.cc
@@ -1,12 +1,11 @@
#include <nan.h>
-void Method(const Nan::FunctionCallbackInfo<v8::Value>& info) {
+NAN_METHOD(Method) {
info.GetReturnValue().Set(Nan::New("world").ToLocalChecked());
}
-void Init(v8::Local<v8::Object> exports) {
- exports->Set(Nan::New("hello").ToLocalChecked(),
- Nan::New<v8::FunctionTemplate>(Method)->GetFunction());
+NAN_MODULE_INIT(Init) {
+ Nan::SetMethod(target, "hello", Method);
}
NODE_MODULE(hello, Init)

19
node-gyp-node12.patch Normal file
View File

@ -0,0 +1,19 @@
commit 89a002e41ee6e4ba590335d5eb2226d179daf20e
Author: Tom Hughes <tom@compton.nu>
Date: Fri Jul 26 08:57:22 2019 +0100
Fix tests for changes in Node.js 12.x
diff --git a/test/node_modules/hello_world/hello.cc b/test/node_modules/hello_world/hello.cc
index 89bfd7a..7065896 100644
--- a/test/node_modules/hello_world/hello.cc
+++ b/test/node_modules/hello_world/hello.cc
@@ -6,7 +6,7 @@ void Method(const Nan::FunctionCallbackInfo<v8::Value>& info) {
void Init(v8::Local<v8::Object> exports) {
exports->Set(Nan::New("hello").ToLocalChecked(),
- Nan::New<v8::FunctionTemplate>(Method)->GetFunction());
+ Nan::GetFunction(Nan::New<v8::FunctionTemplate>(Method)).ToLocalChecked());
}
NODE_MODULE(hello, Init)

View File

@ -1,7 +1,7 @@
%{?nodejs_find_provides_and_requires} %{?nodejs_find_provides_and_requires}
Name: node-gyp Name: node-gyp
Version: 3.6.0 Version: 3.6.0
Release: 2 Release: 7
Summary: Node.js native addon build tool Summary: Node.js native addon build tool
License: MIT License: MIT
URL: https://github.com/nodejs/node-gyp URL: https://github.com/nodejs/node-gyp
@ -11,13 +11,14 @@ Patch1: node-gyp-addon-gypi.patch
Patch2: node-gyp-system-gyp.patch Patch2: node-gyp-system-gyp.patch
Patch3: node-gyp-python.patch Patch3: node-gyp-python.patch
Patch4: node-gyp-python3.patch Patch4: node-gyp-python3.patch
Patch5: fix-addon-test-for-Node.js-12-and-v8.patch
BuildArch: noarch BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch ExclusiveArch: %{nodejs_arches} noarch
Requires: gyp nodejs-devel libuv-devel http-parser-devel gcc-c++ Requires: gyp nodejs-devel libuv-devel http-parser-devel gcc-c++
BuildRequires: gyp nodejs-devel libuv-devel http-parser-devel gcc-c++ BuildRequires: gyp nodejs-devel libuv-devel http-parser-devel gcc-c++
BuildRequires: npm(tape) npm(bindings) npm(fstream) npm(glob) npm(graceful-fs) npm(minimatch) BuildRequires: npm(tape) npm(bindings) npm(fstream) npm(glob) npm(graceful-fs) npm(minimatch)
BuildRequires: npm(mkdirp) npm(nan) npm(nopt) npm(npmlog) npm(osenv) npm(path-array) BuildRequires: npm(mkdirp) npm(nan) >= 2.0.0 npm(nopt) npm(npmlog) npm(osenv) npm(path-array)
BuildRequires: npm(request) npm(require-inject) npm(rimraf) npm(semver) npm(tar) npm(which) BuildRequires: npm(request) npm(require-inject) npm(rimraf) npm(semver) npm(tar) npm(which) vim
%description %description
node-gyp is a cross-platform command-line tool written in Node.js for compiling node-gyp is a cross-platform command-line tool written in Node.js for compiling
native addon modules for Node.js, which takes away the pain of dealing with the native addon modules for Node.js, which takes away the pain of dealing with the
@ -26,6 +27,8 @@ program which is removed for node v0.8.
%prep %prep
%autosetup -p1 %autosetup -p1
# Fix load error for nodejs-20.x https://github.com/nwjs/nw-gyp/issues/155#issuecomment-1308701166
sed -i 's/process.config || {}/JSON.parse(JSON.stringify(process.config)) || {}/g' lib/configure.js
cp -p %{SOURCE1} addon-rpm.gypi cp -p %{SOURCE1} addon-rpm.gypi
%nodejs_fixdep glob "^6.0.4" %nodejs_fixdep glob "^6.0.4"
%nodejs_fixdep minimatch "^3.0.0" %nodejs_fixdep minimatch "^3.0.0"
@ -42,6 +45,7 @@ ln -sf ../lib/node_modules/node-gyp/bin/node-gyp.js %{buildroot}%{_bindir}/node-
%check %check
%{nodejs_symlink_deps} --check %{nodejs_symlink_deps} --check
rm -f test/test-download.js
%{nodejs_sitelib}/tape/bin/tape test/test-*.js %{nodejs_sitelib}/tape/bin/tape test/test-*.js
%files %files
@ -51,6 +55,21 @@ ln -sf ../lib/node_modules/node-gyp/bin/node-gyp.js %{buildroot}%{_bindir}/node-
%{_bindir}/node-gyp %{_bindir}/node-gyp
%changelog %changelog
* Tue Jan 02 2024 wangkai <13474090681@163.com> - 3.6.0-7
- Fix load error for nodejs-20.x
* Fri Feb 10 2023 xu_ping <xuping33@h-partners.com> - 3.6.0-6
- fix test error
* Tue Jul 05 2022 wangkai <wangkai385@h-partners.com> - 3.6.0-5
- Remove test-download
* Thu Jan 21 2021 lingsheng <lingsheng@huawei.com> - 3.6.0-4
- Limit npm(nan) version to fix test errors
* Tue Dec 29 2020 huanghaitao <huanghaitao8@huawei.com> - 3.6.0-3
- Fix test errors in node 12+
* Tue Sep 15 2020 chengzihan <chengzihan2@huawei.com> - 3.6.0-2 * Tue Sep 15 2020 chengzihan <chengzihan2@huawei.com> - 3.6.0-2
- add patch node-gyp-python3.patch - add patch node-gyp-python3.patch
- default to python3 instead of python2 - default to python3 instead of python2