blob: 5cb2e97015eb2a316bdad4c204ed2f7ec346abaf [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001From 62ddf8499747fb1e366477d666c0634ad50039a9 Mon Sep 17 00:00:00 2001
2From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
3Date: Tue, 19 Mar 2019 23:22:40 -0400
4Subject: [PATCH 2/2] Install both binaries and use libdir.
5
6This allows us to build with a shared library for other users while
7still providing the normal executable.
8
9Taken from - https://src.fedoraproject.org/rpms/nodejs/raw/rawhide/f/0002-Install-both-binaries-and-use-libdir.patch
10
11Upstream-Status: Pending
12
13Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
14Signed-off-by: Andreas MΓΌller <schnitzeltony@gmail.com>
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 configure.py | 7 +++++++
18 tools/install.py | 21 +++++++++------------
19 2 files changed, 16 insertions(+), 12 deletions(-)
20
21diff --git a/configure.py b/configure.py
22index 6efb98c2316f089f3167e486282593245373af3f..a6d2ec939e4480dfae703f3978067537abf9f0f0 100755
23--- a/configure.py
24+++ b/configure.py
25@@ -721,10 +721,16 @@ parser.add_argument('--shared',
26 dest='shared',
27 default=None,
28 help='compile shared library for embedding node in another project. ' +
29 '(This mode is not officially supported for regular applications)')
30
31+parser.add_argument('--libdir',
32+ action='store',
33+ dest='libdir',
34+ default='lib',
35+ help='a directory to install the shared library into')
36+
37 parser.add_argument('--without-v8-platform',
38 action='store_true',
39 dest='without_v8_platform',
40 default=False,
41 help='do not initialize v8 platform during node.js startup. ' +
42@@ -1305,10 +1311,11 @@ def configure_node(o):
43 o['variables']['debug_nghttp2'] = 'false'
44
45 o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)
46
47 o['variables']['node_shared'] = b(options.shared)
48+ o['variables']['libdir'] = options.libdir
49 node_module_version = getmoduleversion.get_version()
50
51 if options.dest_os == 'android':
52 shlib_suffix = 'so'
53 elif sys.platform == 'darwin':
54diff --git a/tools/install.py b/tools/install.py
55index 41cc1cbc60a9480cc08df3aa0ebe582c2becc3a2..11208f9e7166ab60da46d5ace2257c239a7e9263 100755
56--- a/tools/install.py
57+++ b/tools/install.py
58@@ -128,26 +128,23 @@ def subdir_files(path, dest, action):
59 for subdir, files_in_path in ret.items():
60 action(files_in_path, subdir + '/')
61
62 def files(action):
63 is_windows = sys.platform == 'win32'
64- output_file = 'node'
65 output_prefix = 'out/Release/'
66+ output_libprefix = output_prefix
67
68- if 'false' == variables.get('node_shared'):
69- if is_windows:
70- output_file += '.exe'
71+ if is_windows:
72+ output_bin = 'node.exe'
73+ output_lib = 'node.dll'
74 else:
75- if is_windows:
76- output_file += '.dll'
77- else:
78- output_file = 'lib' + output_file + '.' + variables.get('shlib_suffix')
79+ output_bin = 'node'
80+ output_lib = 'libnode.' + variables.get('shlib_suffix')
81
82- if 'false' == variables.get('node_shared'):
83- action([output_prefix + output_file], 'bin/' + output_file)
84- else:
85- action([output_prefix + output_file], 'lib/' + output_file)
86+ action([output_prefix + output_bin], 'bin/' + output_bin)
87+ if 'true' == variables.get('node_shared'):
88+ action([output_libprefix + output_lib], variables.get('libdir') + '/' + output_lib)
89
90 if 'true' == variables.get('node_use_dtrace'):
91 action(['out/Release/node.d'], 'lib/dtrace/node.d')
92
93 # behave similarly for systemtap
94--
952.33.0
96