blob: 622392099012ee5ac857f66684ab8463e3e77509 [file] [log] [blame]
Andrew Geisslerf103a7f2021-05-07 16:09:40 -05001From 5b22fac923d1ca3e9fefb97f5a171124a88f5e22 Mon Sep 17 00:00:00 2001
Brad Bishope42b3e32020-01-15 22:08:42 -05002From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
3Date: Tue, 19 Mar 2019 23:22:40 -0400
Andrew Geisslerf103a7f2021-05-07 16:09:40 -05004Subject: [PATCH] Install both binaries and use libdir.
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
Brad Bishope42b3e32020-01-15 22:08:42 -05008
9This allows us to build with a shared library for other users while
10still providing the normal executable.
11
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050012Taken from - https://src.fedoraproject.org/rpms/nodejs/raw/rawhide/f/0002-Install-both-binaries-and-use-libdir.patch
Brad Bishope42b3e32020-01-15 22:08:42 -050013
14Upstream-Status: Pending
15
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050016Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Brad Bishope42b3e32020-01-15 22:08:42 -050017Signed-off-by: Andreas MΓΌller <schnitzeltony@gmail.com>
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050018Signed-off-by: Khem Raj <raj.khem@gmail.com>
Brad Bishope42b3e32020-01-15 22:08:42 -050019---
20 configure.py | 7 +++++++
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050021 tools/install.py | 21 +++++++++------------
22 2 files changed, 16 insertions(+), 12 deletions(-)
Brad Bishope42b3e32020-01-15 22:08:42 -050023
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050024diff --git a/configure.py b/configure.py
25index e6f7e4db..6cf5c45d 100755
Brad Bishope42b3e32020-01-15 22:08:42 -050026--- a/configure.py
27+++ b/configure.py
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050028@@ -626,6 +626,12 @@ parser.add_option('--shared',
Brad Bishope42b3e32020-01-15 22:08:42 -050029 help='compile shared library for embedding node in another project. ' +
30 '(This mode is not officially supported for regular applications)')
31
32+parser.add_option('--libdir',
33+ action='store',
34+ dest='libdir',
35+ default='lib',
36+ help='a directory to install the shared library into')
37+
38 parser.add_option('--without-v8-platform',
39 action='store_true',
40 dest='without_v8_platform',
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050041@@ -1202,6 +1208,7 @@ def configure_node(o):
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050042 o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
43
Brad Bishope42b3e32020-01-15 22:08:42 -050044 o['variables']['node_shared'] = b(options.shared)
45+ o['variables']['libdir'] = options.libdir
46 node_module_version = getmoduleversion.get_version()
47
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050048 if options.dest_os == 'android':
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050049diff --git a/tools/install.py b/tools/install.py
50index 729b416f..9bfc6234 100755
Brad Bishope42b3e32020-01-15 22:08:42 -050051--- a/tools/install.py
52+++ b/tools/install.py
Andrew Geisslerf103a7f2021-05-07 16:09:40 -050053@@ -121,22 +121,19 @@ def subdir_files(path, dest, action):
Brad Bishope42b3e32020-01-15 22:08:42 -050054
55 def files(action):
56 is_windows = sys.platform == 'win32'
57- output_file = 'node'
58 output_prefix = 'out/Release/'
59+ output_libprefix = output_prefix
60
61- if 'false' == variables.get('node_shared'):
62- if is_windows:
63- output_file += '.exe'
64+ if is_windows:
65+ output_bin = 'node.exe'
66+ output_lib = 'node.dll'
67 else:
68- if is_windows:
69- output_file += '.dll'
70- else:
71- output_file = 'lib' + output_file + '.' + variables.get('shlib_suffix')
Brad Bishope42b3e32020-01-15 22:08:42 -050072+ output_bin = 'node'
73+ output_lib = 'libnode.' + variables.get('shlib_suffix')
Andrew Geisslerbffdb3e2020-08-21 16:13:29 -050074
75- if 'false' == variables.get('node_shared'):
76- action([output_prefix + output_file], 'bin/' + output_file)
77- else:
78- action([output_prefix + output_file], 'lib/' + output_file)
Brad Bishope42b3e32020-01-15 22:08:42 -050079+ action([output_prefix + output_bin], 'bin/' + output_bin)
80+ if 'true' == variables.get('node_shared'):
81+ action([output_libprefix + output_lib], variables.get('libdir') + '/' + output_lib)
82
83 if 'true' == variables.get('node_use_dtrace'):
84 action(['out/Release/node.d'], 'lib/dtrace/node.d')