nodejs20/versioned.patch

188 lines
6.8 KiB
Diff
Raw Permalink Normal View History

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
Index: node-v20.13.1/Makefile
===================================================================
--- node-v20.13.1.orig/Makefile
+++ node-v20.13.1/Makefile
@@ -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 = node20$(EXEEXT)
# Use $(PWD) so we can cd to anywhere before calling this
NODE ?= "$(PWD)/$(NODE_EXE)"
NODE_G_EXE = node_g$(EXEEXT)
Index: node-v20.13.1/tools/install.py
===================================================================
--- node-v20.13.1.orig/tools/install.py
+++ node-v20.13.1/tools/install.py
@@ -87,7 +87,7 @@ def uninstall(options, paths, dest):
try_remove(options, path, dest)
def package_files(options, action, name, bins):
- target_path = os.path.join(libdir(options), 'node_modules', name)
+ target_path = os.path.join(libdir(options), 'node_modules', name + '20')
# don't install npm if the target path is a symlink, it probably means
# that a dev version of npm is installed there
@@ -108,19 +108,19 @@ def package_files(options, action, name,
if action == uninstall:
action(options, [link_path], os.path.join('bin', bin_name))
elif action == install:
- 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 + '20', bin_target), link_path)
else:
assert 0 # unhandled action type
def npm_files(options, action):
package_files(options, action, 'npm', {
- 'npm': 'bin/npm-cli.js',
- 'npx': 'bin/npx-cli.js',
+ 'npm20': 'bin/npm-cli.js',
+ 'npx20': 'bin/npx-cli.js',
})
def corepack_files(options, action):
package_files(options, action, 'corepack', {
- 'corepack': 'dist/corepack.js',
+ 'corepack20': 'dist/corepack.js',
# Not the default just yet:
# 'yarn': 'dist/yarn.js',
# 'yarnpkg': 'dist/yarn.js',
@@ -149,7 +149,7 @@ def subdir_files(options, path, dest, ac
action(options, files_in_path, subdir + os.path.sep)
def files(options, action):
- node_bin = 'node'
+ node_bin = 'node20'
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):
if 'openbsd' in sys.platform:
action(options, ['doc/node.1'], 'man/man1/')
else:
- action(options, ['doc/node.1'], 'share/man/man1/')
+ action(options, ['doc/node.1'], 'share/man/man1/node20.1')
if 'true' == options.variables.get('node_install_npm'):
npm_files(options, action)
@@ -331,28 +331,28 @@ def headers(options, action):
'src/node_buffer.h',
'src/node_object_wrap.h',
'src/node_version.h',
- ], 'include/node/')
+ ], 'include/node20/')
# Add the expfile that is created on AIX
if sys.platform.startswith('aix') or sys.platform == "os400":
action(options, ['out/Release/node.exp'], 'include/node/')
- 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/node20/', wanted_v8_headers)
if 'false' == options.variables.get('node_shared_libuv'):
- subdir_files(options, 'deps/uv/include', 'include/node/', action)
+ subdir_files(options, 'deps/uv/include', 'include/node20/', action)
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/node20/openssl/', action)
+ subdir_files(options, 'deps/openssl/config/archs', 'include/node20/openssl/archs', action)
+ subdir_files(options, 'deps/openssl/config', 'include/node20/openssl', action)
if 'false' == options.variables.get('node_shared_zlib'):
action(options, [
'deps/zlib/zconf.h',
'deps/zlib/zlib.h',
- ], 'include/node/')
+ ], 'include/node20/')
if sys.platform == 'zos':
zoslibinc = os.environ.get('ZOSLIB_INCLUDES')
Index: node-v20.13.1/doc/node.1
===================================================================
--- node-v20.13.1.orig/doc/node.1
+++ node-v20.13.1/doc/node.1
@@ -31,24 +31,24 @@
.Dt NODE 1
.
.Sh NAME
-.Nm node
+.Nm node20
.Nd server-side JavaScript runtime
.
.\"======================================================================
.Sh SYNOPSIS
-.Nm node
+.Nm node20
.Op Ar options
.Op Ar v8-options
.Op Fl e Ar string | Ar script.js | Fl
.Op Fl -
.Op Ar arguments ...
.
-.Nm node
+.Nm node20
.Cm inspect
.Op Fl e Ar string | Ar script.js | Fl | Ar <host>:<port>
.Ar ...
.
-.Nm node
+.Nm node20
.Op Fl -v8-options
.
.\"======================================================================
Index: node-v20.13.1/src/node_main.cc
===================================================================
--- node-v20.13.1.orig/src/node_main.cc
+++ node-v20.13.1/src/node_main.cc
@@ -94,6 +94,7 @@ int wmain(int argc, wchar_t* wargv[]) {
// UNIX
int main(int argc, char* argv[]) {
+ setenv("NODE_VERSION", "20", 0);
return node::Start(argc, argv);
}
#endif
Index: node-v20.13.1/tools/test.py
===================================================================
--- node-v20.13.1.orig/tools/test.py
+++ node-v20.13.1/tools/test.py
@@ -954,7 +954,7 @@ class Context(object):
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/node20'
else:
name = 'out/%s.%s/node' % (arch, mode)
Index: node-v20.13.1/node.gyp
===================================================================
--- node-v20.13.1.orig/node.gyp
+++ node-v20.13.1/node.gyp
@@ -24,8 +24,8 @@
'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%': 'node20',
+ 'node_lib_target_name%': 'libnode20',
'node_intermediate_lib_type%': 'static_library',
'node_builtin_modules_path%': '',
'linked_module_files': [