diff --git a/fix-addon-test-for-Node.js-12-and-v8.patch b/fix-addon-test-for-Node.js-12-and-v8.patch deleted file mode 100644 index f599ffa374a9600e453746912014e250c96e0030..0000000000000000000000000000000000000000 --- a/fix-addon-test-for-Node.js-12-and-v8.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e6699d13cdcd6abe543b250f4297808912a4a188 Mon Sep 17 00:00:00 2001 -From: Richard Lau -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 -Reviewed-By: Ben Noordhuis ---- - 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 - --void Method(const Nan::FunctionCallbackInfo& info) { -+NAN_METHOD(Method) { - info.GetReturnValue().Set(Nan::New("world").ToLocalChecked()); - } - --void Init(v8::Local exports) { -- exports->Set(Nan::New("hello").ToLocalChecked(), -- Nan::New(Method)->GetFunction()); -+NAN_MODULE_INIT(Init) { -+ Nan::SetMethod(target, "hello", Method); - } - - NODE_MODULE(hello, Init) diff --git a/node-gyp-3.6.0.tar.gz b/node-gyp-3.6.0.tar.gz deleted file mode 100644 index 39177953f27572c587f37f4662ed07598c795b6d..0000000000000000000000000000000000000000 Binary files a/node-gyp-3.6.0.tar.gz and /dev/null differ diff --git a/node-gyp-9.3.1.tar.gz b/node-gyp-9.3.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..06991e1d51eba93be97004f7d39482ee4fb2ebac Binary files /dev/null and b/node-gyp-9.3.1.tar.gz differ diff --git a/node-gyp-addon-gypi.patch b/node-gyp-addon-gypi.patch deleted file mode 100644 index 245d00b4cdf66931f506b00e0e3bda8774fd8258..0000000000000000000000000000000000000000 --- a/node-gyp-addon-gypi.patch +++ /dev/null @@ -1,62 +0,0 @@ -commit 4daac6e35e1ea8e886a823785e7b06e80c933ac2 -Author: Tom Hughes -Date: Mon Jan 18 17:06:18 2016 +0000 - - Use custom addon.gypi by default instead of downloading node source - -diff --git a/lib/configure.js b/lib/configure.js -index 4e06529..046c12f 100644 ---- a/lib/configure.js -+++ b/lib/configure.js -@@ -59,24 +59,26 @@ function configure (gyp, argv, callback) { - if ('v' + release.version !== process.version) { - // if --target was given, then determine a target version to compile for - log.verbose('get node dir', 'compiling against --target node version: %s', release.version) -- } else { -- // if no --target was specified then use the current host node version -- log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) -- } - -- if (!release.semver) { -- // could not parse the version string with semver -- return callback(new Error('Invalid version number: ' + release.version)) -- } -+ if (!release.semver) { -+ // could not parse the version string with semver -+ return callback(new Error('Invalid version number: ' + release.version)) -+ } - -- // ensure that the target node version's dev files are installed -- gyp.opts.ensure = true -- gyp.commands.install([ release.version ], function (err, version) { -- if (err) return callback(err) -- log.verbose('get node dir', 'target node version installed:', release.versionDir) -- nodeDir = path.resolve(gyp.devDir, release.versionDir) -+ // ensure that the target node version's dev files are installed -+ gyp.opts.ensure = true -+ gyp.commands.install([ release.version ], function (err, version) { -+ if (err) return callback(err) -+ log.verbose('get node dir', 'target node version installed:', release.versionDir) -+ nodeDir = path.resolve(gyp.devDir, release.versionDir) -+ createBuildDir() -+ }) -+ } else { -+ // if no --target was specified then use RPM installed headers -+ log.verbose('get node dir', 'no --target version specified, falling back to RPM installed headers') -+ nodeDir = '/usr/share/node' - createBuildDir() -- }) -+ } - } - } - -@@ -248,7 +250,8 @@ function configure (gyp, argv, callback) { - - // this logic ported from the old `gyp_addon` python file - var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') -- var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') -+ var addon_gypi_file = gyp.opts.target || gyp.opts.nodeDir ? 'addon.gypi' : 'addon-rpm.gypi' -+ var addon_gypi = path.resolve(__dirname, '..', addon_gypi_file) - var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') - fs.stat(common_gypi, function (err, stat) { - if (err) diff --git a/node-gyp-node12.patch b/node-gyp-node12.patch deleted file mode 100644 index 0d84ead7078cd2e60eaa481d7c450a7e49337861..0000000000000000000000000000000000000000 --- a/node-gyp-node12.patch +++ /dev/null @@ -1,19 +0,0 @@ -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-python.patch b/node-gyp-python.patch deleted file mode 100644 index 4c7931802c1ff01c4c6d9de85900fcc3429aed3c..0000000000000000000000000000000000000000 --- a/node-gyp-python.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 6d43ce52005c977ce8df57440a82bb346d3fc4cc -Author: Tom Hughes -Date: Sat Jul 14 19:32:14 2018 +0100 - - Don't test that python exists - -diff --git a/test/test-find-python.js b/test/test-find-python.js -index 30ba6df..2581a8e 100644 ---- a/test/test-find-python.js -+++ b/test/test-find-python.js -@@ -5,21 +5,6 @@ var configure = require('../lib/configure') - var execFile = require('child_process').execFile - var PythonFinder = configure.test.PythonFinder - --test('find python', function (t) { -- t.plan(4) -- -- configure.test.findPython('python', function (err, found) { -- t.strictEqual(err, null) -- var proc = execFile(found, ['-V'], function (err, stdout, stderr) { -- t.strictEqual(err, null) -- t.strictEqual(stdout, '') -- t.ok(/Python 2/.test(stderr)) -- }) -- proc.stdout.setEncoding('utf-8') -- proc.stderr.setEncoding('utf-8') -- }) --}) -- - function poison(object, property) { - function fail() { - throw new Error('Property ' + property + ' should not have been accessed.') diff --git a/node-gyp-python3.patch b/node-gyp-python3.patch deleted file mode 100644 index ff2f540f06127749516c1546b0538008c25cf545..0000000000000000000000000000000000000000 --- a/node-gyp-python3.patch +++ /dev/null @@ -1,104 +0,0 @@ -commit d0eb1892fcb0b256fc2b0e747a51d94ab0da3cb3 -Author: Tom Hughes -Date: Thu Aug 15 21:30:32 2019 +0100 - - Default to python3 instead of python2 - -diff --git a/lib/configure.js b/lib/configure.js -index 5538e44..0f7c19b 100644 ---- a/lib/configure.js -+++ b/lib/configure.js -@@ -29,7 +29,7 @@ exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' f - - function configure (gyp, argv, callback) { - -- var python = gyp.opts.python || process.env.PYTHON || 'python2' -+ var python = gyp.opts.python || process.env.PYTHON || 'python3' - , buildDir = path.resolve('build') - , configNames = [ 'config.gypi', 'common.gypi' ] - , configs = [] -@@ -461,7 +461,7 @@ PythonFinder.prototype = { - this.log.silly('stripping "rc" identifier from version') - version = version.replace(/rc(.*)$/ig, '') - } -- var range = semver.Range('>=2.5.0 <3.0.0') -+ var range = semver.Range('>=3.7.0 <4.0.0') - var valid = false - try { - valid = range.test(version) -@@ -490,7 +490,7 @@ PythonFinder.prototype = { - 'Python executable "' + this.python + - '" is v' + badVersion + ', which is not supported by gyp.\n' + - 'You can pass the --python switch to point to ' + -- 'Python >= v2.5.0 & < 3.0.0.' -+ 'Python >= v3.7.0 & < 4.0.0.' - this.callback(new Error(errmsg)) - }, - -diff --git a/test/test-find-python.js b/test/test-find-python.js -index 2581a8e..4a43fd3 100644 ---- a/test/test-find-python.js -+++ b/test/test-find-python.js -@@ -38,7 +38,7 @@ test('find python - python', function (t) { - f.execFile = function(program, args, opts, cb) { - t.strictEqual(program, 'python') - t.ok(/import platform/.test(args[1])) -- cb(null, '2.7.0') -+ cb(null, '3.7.0') - } - f.checkPython() - -@@ -59,7 +59,7 @@ test('find python - python too old', function (t) { - f.execFile = function(program, args, opts, cb) { - t.strictEqual(program, 'python') - t.ok(/import platform/.test(args[1])) -- cb(null, '2.3.4') -+ cb(null, '3.4.5') - } - f.checkPython() - -@@ -79,7 +79,7 @@ test('find python - python too new', function (t) { - f.execFile = function(program, args, opts, cb) { - t.strictEqual(program, 'python') - t.ok(/import platform/.test(args[1])) -- cb(null, '3.0.0') -+ cb(null, '4.0.0') - } - f.checkPython() - -@@ -118,7 +118,7 @@ test('find python - no python2', function (t) { - f.execFile = function(program, args, opts, cb) { - t.strictEqual(program, 'python') - t.ok(/import platform/.test(args[1])) -- cb(null, '2.7.0') -+ cb(null, '3.7.0') - } - f.checkPython() - -@@ -165,7 +165,7 @@ test('find python - no python, use python launcher', function (t) { - f.execFile = function(program, args, opts, cb) { - t.strictEqual(program, 'Z:\\snake.exe') - t.ok(/import platform/.test(args[1])) -- cb(null, '2.7.0') -+ cb(null, '3.7.0') - } - t.strictEqual(program, 'py.exe') - t.notEqual(args.indexOf('-2'), -1) -@@ -196,7 +196,7 @@ test('find python - python 3, use python launcher', function (t) { - f.execFile = function(program, args, opts, cb) { - t.strictEqual(program, 'Z:\\snake.exe') - t.ok(/import platform/.test(args[1])) -- cb(null, '2.7.0') -+ cb(null, '3.7.0') - } - t.strictEqual(program, 'py.exe') - t.notEqual(args.indexOf('-2'), -1) -@@ -267,7 +267,7 @@ test('find python - no python, no python launcher, good guess', function (t) { - f.execFile = function(program, args, opts, cb) { - t.ok(re.test(program)) - t.ok(/import platform/.test(args[1])) -- cb(null, '2.7.0') -+ cb(null, '3.7.0') - } - t.strictEqual(program, 'py.exe') - cb(new Error('not found')) diff --git a/node-gyp-system-gyp.patch b/node-gyp-system-gyp.patch deleted file mode 100644 index d8239e9086b2e9a3b6f9b4ebec2c865a6de7d44e..0000000000000000000000000000000000000000 --- a/node-gyp-system-gyp.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit 31b5c191833a9c122de1c52ad53220da4ccd4589 -Author: Tom Hughes -Date: Mon Jan 18 17:07:41 2016 +0000 - - Use the system gyp - -diff --git a/lib/configure.js b/lib/configure.js -index 046c12f..65e78b4 100644 ---- a/lib/configure.js -+++ b/lib/configure.js -@@ -249,7 +249,7 @@ function configure (gyp, argv, callback) { - } - - // this logic ported from the old `gyp_addon` python file -- var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') -+ var gyp_script = '/usr/bin/gyp' - var addon_gypi_file = gyp.opts.target || gyp.opts.nodeDir ? 'addon.gypi' : 'addon-rpm.gypi' - var addon_gypi = path.resolve(__dirname, '..', addon_gypi_file) - var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') diff --git a/node-gyp.spec b/node-gyp.spec index 7e18b702b1e38545ab2c615ee0e6ac0598d4ce18..f55cae92fcb298562da598deef2fd8ec781d5bfa 100644 --- a/node-gyp.spec +++ b/node-gyp.spec @@ -1,22 +1,17 @@ %{?nodejs_find_provides_and_requires} Name: node-gyp -Version: 3.6.0 -Release: 7 +Version: 9.3.1 +Release: 1 Summary: Node.js native addon build tool License: MIT URL: https://github.com/nodejs/node-gyp Source0: https://github.com/nodejs/node-gyp/archive/v%{version}/node-gyp-%{version}.tar.gz Source1: addon-rpm.gypi -Patch1: node-gyp-addon-gypi.patch -Patch2: node-gyp-system-gyp.patch -Patch3: node-gyp-python.patch -Patch4: node-gyp-python3.patch -Patch5: fix-addon-test-for-Node.js-12-and-v8.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(tap) npm(tape) npm(bindings) npm(fstream) npm(glob) npm(graceful-fs) npm(minimatch) 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) vim %description @@ -27,8 +22,6 @@ program which is removed for node v0.8. %prep %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 %nodejs_fixdep glob "^6.0.4" %nodejs_fixdep minimatch "^3.0.0" @@ -55,6 +48,9 @@ rm -f test/test-download.js %{_bindir}/node-gyp %changelog +* Thu Mar 14 2024 Dongxing Wang - 9.3.1-1 +- Upgrade to version 9.3.1 + * Tue Jan 02 2024 wangkai <13474090681@163.com> - 3.6.0-7 - Fix load error for nodejs-20.x