nodejs/0002-build-add-libdir-flag-to-configure.patch
Stephen Gallagher da21b9cec2
Update to Node.js 16.17.0
- https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V16.md#16.17.0

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2022-09-14 16:22:06 -04:00

70 lines
2.8 KiB
Diff

From f2994693ae8c81c033f366a6a7853fe1db6b91f9 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Sun, 28 Aug 2022 04:12:42 -0400
Subject: [PATCH 2/2] build: add --libdir flag to configure
This will allow distribution packages to select an alternative
location for the unofficial libnode.so. For example, on Fedora it
will install into /usr/lib64 on 64-bit systems.
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/44361
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
---
configure.py | 9 +++++++++
tools/install.py | 4 ++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/configure.py b/configure.py
index 1a7023dece588631b8281c67b223204c1ebb5ee7..67d0cc695e67077f5c74f04ccf761807dd7fb3ef 100755
--- a/configure.py
+++ b/configure.py
@@ -739,6 +739,14 @@ parser.add_argument('--shared',
help='compile shared library for embedding node in another project. ' +
'(This mode is not officially supported for regular applications)')
+parser.add_argument('--libdir',
+ action='store',
+ dest='libdir',
+ default='lib',
+ help='a directory to install the shared library into relative to the '
+ 'prefix. This is a no-op if --shared is not specified. ' +
+ '(This mode is not officially supported for regular applications)')
+
parser.add_argument('--without-v8-platform',
action='store_true',
dest='without_v8_platform',
@@ -1368,6 +1376,7 @@ def configure_node(o):
o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
o['variables']['node_shared'] = b(options.shared)
+ o['variables']['libdir'] = options.libdir
node_module_version = getmoduleversion.get_version()
if options.dest_os == 'android':
diff --git a/tools/install.py b/tools/install.py
index a6d1f8b3caa8e24148b1930ea109508f8e612735..f9f4b3c6c0f4297a5b44c44bc1cccc7bfe3ef2b0 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -169,14 +169,14 @@ def files(action):
# install libnode.version.so
so_name = 'libnode.' + re.sub(r'\.x$', '.so', variables.get('shlib_suffix'))
- action([output_prefix + so_name], 'lib/' + so_name)
+ action([output_prefix + so_name], variables.get('libdir') + '/' + so_name)
# create symlink of libnode.so -> libnode.version.so (C++ addons compat)
link_path = abspath(install_path, 'lib/libnode.so')
try_symlink(so_name, link_path)
else:
output_lib = 'libnode.' + variables.get('shlib_suffix')
- action([output_prefix + output_lib], 'lib/' + output_lib)
+ action([output_prefix + output_lib], variables.get('libdir') + '/' + output_lib)
if 'true' == variables.get('node_use_dtrace'):
action(['out/Release/node.d'], 'lib/dtrace/node.d')
--
2.37.3