blob: 7aa70fec993651e30aa9dfb428de715b9d284e3f [file] [log] [blame]
Brad Bishope42b3e32020-01-15 22:08:42 -05001From 5bfeffdf4b5de1c60a2ff0d1ddf65db2bb9a1533 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 3/3] 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
9Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
10
11Stolen from [1]
12
13[1] https://src.fedoraproject.org/rpms/nodejs/raw/master/f/0003-Install-both-binaries-and-use-libdir.patch
14
15Upstream-Status: Pending
16
17Signed-off-by: Andreas MΓΌller <schnitzeltony@gmail.com>
18
19---
20 configure.py | 7 +++++++
21 tools/install.py | 31 ++++++++++++++-----------------
22 2 files changed, 21 insertions(+), 17 deletions(-)
23
24diff --git a/configure.py b/configure.py
25index cfd4207..eb26f7d 100755
26--- a/configure.py
27+++ b/configure.py
28@@ -552,6 +552,12 @@ parser.add_option('--shared',
29 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',
41@@ -1095,6 +1101,7 @@ def configure_node(o):
42 if options.code_cache_path:
43 o['variables']['node_code_cache_path'] = options.code_cache_path
44 o['variables']['node_shared'] = b(options.shared)
45+ o['variables']['libdir'] = options.libdir
46 node_module_version = getmoduleversion.get_version()
47
48 if sys.platform == 'darwin':
49diff --git a/tools/install.py b/tools/install.py
50index 028c32e..bf443c4 100755
51--- a/tools/install.py
52+++ b/tools/install.py
53@@ -117,26 +117,23 @@ def subdir_files(path, dest, action):
54
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')
72- # GYP will output to lib.target except on OS X, this is hardcoded
73- # in its source - see the _InstallableTargetInstallPath function.
74- if sys.platform != 'darwin':
75- output_prefix += 'lib.target/'
76-
77- if 'false' == variables.get('node_shared'):
78- action([output_prefix + output_file], 'bin/' + output_file)
79- else:
80- action([output_prefix + output_file], 'lib/' + output_file)
81+ output_bin = 'node'
82+ output_lib = 'libnode.' + variables.get('shlib_suffix')
83+ # GYP will output to lib.target except on OS X, this is hardcoded
84+ # in its source - see the _InstallableTargetInstallPath function.
85+ if sys.platform != 'darwin':
86+ output_libprefix += 'lib.target/'
87+
88+ action([output_prefix + output_bin], 'bin/' + output_bin)
89+ if 'true' == variables.get('node_shared'):
90+ action([output_libprefix + output_lib], variables.get('libdir') + '/' + output_lib)
91
92 if 'true' == variables.get('node_use_dtrace'):
93 action(['out/Release/node.d'], 'lib/dtrace/node.d')
94--
952.23.0
96