2023-11-07 10:48:41 +01:00
Author: Adam Majer <amajer@suse.de>
Date: Fri May 11 16:10:16 CEST 2018
Summary: Generate versioned binaries
Generate versioned binaries and install paths
so we can allow concurrent installations and
management via update_alternatives.
This is also important for generation of binary
modules for multiple versions of NodeJS
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/Makefile
2023-11-07 10:48:41 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/Makefile
+++ node-v21.7.1/Makefile
2023-11-07 10:48:41 +01:00
@@ -76,7 +76,7 @@ BUILDTYPE_LOWER := $(shell echo $(BUILDT
EXEEXT := $(shell $(PYTHON) -c \
"import sys; print('.exe' if sys.platform == 'win32' else '')")
-NODE_EXE = node$(EXEEXT)
+NODE_EXE = node21$(EXEEXT)
2024-04-02 16:32:44 +02:00
# Use $(PWD) so we can cd to anywhere before calling this
NODE ?= "$(PWD)/$(NODE_EXE)"
2023-11-07 10:48:41 +01:00
NODE_G_EXE = node_g$(EXEEXT)
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/tools/install.py
2023-11-07 10:48:41 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/tools/install.py
+++ node-v21.7.1/tools/install.py
@@ -87,7 +87,7 @@ def uninstall(options, paths, dest):
try_remove(options, path, dest)
2023-11-07 10:48:41 +01:00
2024-04-02 16:32:44 +02:00
def package_files(options, action, name, bins):
2024-04-03 16:44:33 +02:00
- target_path = os.path.join(libdir(options), 'node_modules', name)
+ target_path = os.path.join(libdir(options), 'node_modules', name + '21')
2023-11-07 10:48:41 +01:00
# don't install npm if the target path is a symlink, it probably means
# that a dev version of npm is installed there
2024-04-02 16:32:44 +02:00
@@ -108,19 +108,19 @@ def package_files(options, action, name,
2023-11-07 10:48:41 +01:00
if action == uninstall:
2024-04-02 16:32:44 +02:00
action(options, [link_path], os.path.join('bin', bin_name))
2023-11-07 10:48:41 +01:00
elif action == install:
2024-04-03 16:44:33 +02:00
- try_symlink(options, os.path.join('..', libdir(options), 'node_modules', name, bin_target), link_path)
+ try_symlink(options, os.path.join('..', libdir(options), 'node_modules', name + 21, bin_target), link_path)
2023-11-07 10:48:41 +01:00
else:
assert 0 # unhandled action type
2024-04-02 16:32:44 +02:00
def npm_files(options, action):
package_files(options, action, 'npm', {
2023-11-07 10:48:41 +01:00
- 'npm': 'bin/npm-cli.js',
- 'npx': 'bin/npx-cli.js',
+ 'npm21': 'bin/npm-cli.js',
+ 'npx21': 'bin/npx-cli.js',
})
2024-04-02 16:32:44 +02:00
def corepack_files(options, action):
package_files(options, action, 'corepack', {
2023-11-07 10:48:41 +01:00
- 'corepack': 'dist/corepack.js',
+ 'corepack21': 'dist/corepack.js',
# Not the default just yet:
# 'yarn': 'dist/yarn.js',
# 'yarnpkg': 'dist/yarn.js',
2024-04-02 16:32:44 +02:00
@@ -149,7 +149,7 @@ def subdir_files(options, path, dest, ac
action(options, files_in_path, subdir + os.path.sep)
2023-11-07 10:48:41 +01:00
2024-04-02 16:32:44 +02:00
def files(options, action):
- node_bin = 'node'
+ node_bin = 'node21'
if options.is_win:
node_bin += '.exe'
action(options, [os.path.join(options.build_dir, node_bin)], os.path.join('bin', node_bin))
@@ -190,7 +190,7 @@ def files(options, action):
2023-11-07 10:48:41 +01:00
if 'freebsd' in sys.platform or 'openbsd' in sys.platform:
2024-04-02 16:32:44 +02:00
action(options, ['doc/node.1'], 'man/man1/')
2023-11-07 10:48:41 +01:00
else:
2024-04-02 16:32:44 +02:00
- action(options, ['doc/node.1'], 'share/man/man1/')
+ action(options, ['doc/node.1'], 'share/man/man1/node21.1')
2023-11-07 10:48:41 +01:00
2024-04-02 16:32:44 +02:00
if 'true' == options.variables.get('node_install_npm'):
npm_files(options, action)
@@ -333,28 +333,28 @@ def headers(options, action):
2023-11-07 10:48:41 +01:00
'src/node_buffer.h',
'src/node_object_wrap.h',
'src/node_version.h',
- ], 'include/node/')
+ ], 'include/node21/')
# Add the expfile that is created on AIX
if sys.platform.startswith('aix') or sys.platform == "os400":
2024-04-02 16:32:44 +02:00
- action(options, ['out/Release/node.exp'], 'include/node/')
+ action(options, ['out/Release/node.exp'], 'include/node21/')
2023-11-07 10:48:41 +01:00
2024-04-02 16:32:44 +02:00
- subdir_files(options, os.path.join(options.v8_dir, 'include'), 'include/node/', wanted_v8_headers)
+ subdir_files(options, os.path.join(options.v8_dir, 'include'), 'include/node21/', wanted_v8_headers)
2023-11-07 10:48:41 +01:00
2024-04-02 16:32:44 +02:00
if 'false' == options.variables.get('node_shared_libuv'):
- subdir_files(options, 'deps/uv/include', 'include/node/', action)
+ subdir_files(options, 'deps/uv/include', 'include/node21/', action)
2023-11-07 10:48:41 +01:00
2024-04-02 16:32:44 +02:00
if 'true' == options.variables.get('node_use_openssl') and \
'false' == options.variables.get('node_shared_openssl'):
- subdir_files(options, 'deps/openssl/openssl/include/openssl', 'include/node/openssl/', action)
- subdir_files(options, 'deps/openssl/config/archs', 'include/node/openssl/archs', action)
- subdir_files(options, 'deps/openssl/config', 'include/node/openssl', action)
+ subdir_files(options, 'deps/openssl/openssl/include/openssl', 'include/node21/openssl/', action)
+ subdir_files(options, 'deps/openssl/config/archs', 'include/node21/openssl/archs', action)
+ subdir_files(options, 'deps/openssl/config', 'include/node21/openssl', action)
2023-11-07 10:48:41 +01:00
2024-04-02 16:32:44 +02:00
if 'false' == options.variables.get('node_shared_zlib'):
action(options, [
2023-11-07 10:48:41 +01:00
'deps/zlib/zconf.h',
'deps/zlib/zlib.h',
- ], 'include/node/')
+ ], 'include/node21/')
if sys.platform == 'zos':
zoslibinc = os.environ.get('ZOSLIB_INCLUDES')
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/doc/node.1
2023-11-07 10:48:41 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/doc/node.1
+++ node-v21.7.1/doc/node.1
2023-11-07 10:48:41 +01:00
@@ -31,24 +31,24 @@
.Dt NODE 1
.
.Sh NAME
-.Nm node
+.Nm node21
.Nd server-side JavaScript runtime
.
.\"======================================================================
.Sh SYNOPSIS
-.Nm node
+.Nm node21
.Op Ar options
.Op Ar v8-options
.Op Fl e Ar string | Ar script.js | Fl
.Op Fl -
.Op Ar arguments ...
.
-.Nm node
+.Nm node21
.Cm inspect
.Op Fl e Ar string | Ar script.js | Fl | Ar <host>:<port>
.Ar ...
.
-.Nm node
+.Nm node21
.Op Fl -v8-options
.
.\"======================================================================
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/src/node_main.cc
2023-11-07 10:48:41 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/src/node_main.cc
+++ node-v21.7.1/src/node_main.cc
2023-11-07 10:48:41 +01:00
@@ -94,6 +94,7 @@ int wmain(int argc, wchar_t* wargv[]) {
// UNIX
int main(int argc, char* argv[]) {
+ setenv("NODE_VERSION", "21", 0);
return node::Start(argc, argv);
}
#endif
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/tools/test.py
2023-11-07 10:48:41 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/tools/test.py
+++ node-v21.7.1/tools/test.py
@@ -954,7 +954,7 @@ class Context(object):
2023-11-07 10:48:41 +01:00
if self.vm is not None:
return self.vm
if arch == 'none':
- name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node'
+ name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node21'
else:
name = 'out/%s.%s/node' % (arch, mode)
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/node.gyp
2023-11-07 10:48:41 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/node.gyp
+++ node-v21.7.1/node.gyp
2023-11-07 14:27:58 +01:00
@@ -24,8 +24,8 @@
2023-11-07 10:48:41 +01:00
'node_shared_openssl%': 'false',
'node_v8_options%': '',
'node_enable_v8_vtunejit%': 'false',
- 'node_core_target_name%': 'node',
- 'node_lib_target_name%': 'libnode',
+ 'node_core_target_name%': 'node21',
+ 'node_lib_target_name%': 'libnode21',
'node_intermediate_lib_type%': 'static_library',
'node_builtin_modules_path%': '',
'linked_module_files': [
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot
2023-11-07 14:27:58 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot
+++ node-v21.7.1/test/fixtures/errors/promise_unhandled_warn_with_error.snapshot
2023-11-07 14:27:58 +01:00
@@ -6,5 +6,5 @@
at *
at *
at *
-(Use `node --trace-warnings ...` to show where the warning was created)
+(Use `node21 --trace-warnings ...` to show where the warning was created)
(node:*) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https:*nodejs.org*api*cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/test/parallel/test-snapshot-warning.js
2023-11-07 14:27:58 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/test/parallel/test-snapshot-warning.js
+++ node-v21.7.1/test/parallel/test-snapshot-warning.js
2023-11-07 14:27:58 +01:00
@@ -60,7 +60,7 @@ tmpdir.refresh();
stderr(output) {
let match = output.match(/Warning: test warning/g);
assert.strictEqual(match.length, 1);
- match = output.match(/Use `node --trace-warnings/g);
+ match = output.match(/Use `node21 --trace-warnings/g);
assert.strictEqual(match.length, 1);
return true;
}
@@ -79,7 +79,7 @@ tmpdir.refresh();
// Warnings should not be handled more than once.
let match = output.match(/Warning: test warning/g);
assert.strictEqual(match.length, 1);
- match = output.match(/Use `node --trace-warnings/g);
+ match = output.match(/Use `node21 --trace-warnings/g);
assert.strictEqual(match.length, 1);
return true;
}
@@ -114,7 +114,7 @@ tmpdir.refresh();
console.log(warningFile1, ':', warnings1);
let match = warnings1.match(/Warning: test warning/g);
assert.strictEqual(match.length, 1);
- match = warnings1.match(/Use `node --trace-warnings/g);
+ match = warnings1.match(/Use `node21 --trace-warnings/g);
assert.strictEqual(match.length, 1);
fs.rmSync(warningFile1, {
maxRetries: 3, recursive: false, force: true
@@ -140,6 +140,6 @@ tmpdir.refresh();
console.log(warningFile2, ':', warnings1);
match = warnings2.match(/Warning: test warning/g);
assert.strictEqual(match.length, 1);
- match = warnings2.match(/Use `node --trace-warnings/g);
+ match = warnings2.match(/Use `node21 --trace-warnings/g);
assert.strictEqual(match.length, 1);
}
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/test/fixtures/errors/throw_error_with_getter_throw.snapshot
2023-11-07 14:27:58 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/test/fixtures/errors/throw_error_with_getter_throw.snapshot
+++ node-v21.7.1/test/fixtures/errors/throw_error_with_getter_throw.snapshot
2023-11-07 14:27:58 +01:00
@@ -3,6 +3,6 @@
throw { * eslint-disable-line no-throw-literal
^
[object Object]
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `node21 --trace-uncaught ...` to show where the exception was thrown)
Node.js *
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/test/fixtures/errors/throw_undefined.snapshot
2023-11-07 14:27:58 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/test/fixtures/errors/throw_undefined.snapshot
+++ node-v21.7.1/test/fixtures/errors/throw_undefined.snapshot
2023-11-07 14:27:58 +01:00
@@ -3,6 +3,6 @@
throw undefined;
^
undefined
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `node21 --trace-uncaught ...` to show where the exception was thrown)
Node.js *
2024-04-02 16:32:44 +02:00
Index: node-v21.7.1/test/fixtures/errors/throw_null.snapshot
2023-11-07 14:27:58 +01:00
===================================================================
2024-04-02 16:32:44 +02:00
--- node-v21.7.1.orig/test/fixtures/errors/throw_null.snapshot
+++ node-v21.7.1/test/fixtures/errors/throw_null.snapshot
2023-11-07 14:27:58 +01:00
@@ -3,6 +3,6 @@
throw null;
^
null
-(Use `node --trace-uncaught ...` to show where the exception was thrown)
+(Use `node21 --trace-uncaught ...` to show where the exception was thrown)
Node.js *