From fc11bb8d5117a04e4b682ca475a1073c2682a252 Mon Sep 17 00:00:00 2001 From: hht8 Date: Tue, 29 Dec 2020 15:55:25 +0800 Subject: [PATCH] fix test errors in node 12+ --- node-gyp-node12.patch | 19 +++++++++++++++++++ node-gyp.spec | 8 ++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 node-gyp-node12.patch diff --git a/node-gyp-node12.patch b/node-gyp-node12.patch new file mode 100644 index 0000000..0d84ead --- /dev/null +++ b/node-gyp-node12.patch @@ -0,0 +1,19 @@ +commit 89a002e41ee6e4ba590335d5eb2226d179daf20e +Author: Tom Hughes +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& info) { + + void Init(v8::Local exports) { + exports->Set(Nan::New("hello").ToLocalChecked(), +- Nan::New(Method)->GetFunction()); ++ Nan::GetFunction(Nan::New(Method)).ToLocalChecked()); + } + + NODE_MODULE(hello, Init) diff --git a/node-gyp.spec b/node-gyp.spec index 9258daa..3de1507 100644 --- a/node-gyp.spec +++ b/node-gyp.spec @@ -1,7 +1,7 @@ %{?nodejs_find_provides_and_requires} Name: node-gyp Version: 3.6.0 -Release: 2 +Release: 3 Summary: Node.js native addon build tool License: MIT URL: https://github.com/nodejs/node-gyp @@ -11,13 +11,14 @@ Patch1: node-gyp-addon-gypi.patch Patch2: node-gyp-system-gyp.patch Patch3: node-gyp-python.patch Patch4: node-gyp-python3.patch +Patch5: node-gyp-node12.patch BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch Requires: 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(mkdirp) npm(nan) 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 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 @@ -51,6 +52,9 @@ ln -sf ../lib/node_modules/node-gyp/bin/node-gyp.js %{buildroot}%{_bindir}/node- %{_bindir}/node-gyp %changelog +* The Dec 29 2020 huanghaitao - 3.6.0-3 +- Fix test errors in node 12+ + * Tue Sep 15 2020 chengzihan - 3.6.0-2 - add patch node-gyp-python3.patch - default to python3 instead of python2 -- Gitee