Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 1 | From 5b22fac923d1ca3e9fefb97f5a171124a88f5e22 Mon Sep 17 00:00:00 2001 |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 2 | From: Elliott Sales de Andrade <quantum.analyst@gmail.com> |
| 3 | Date: Tue, 19 Mar 2019 23:22:40 -0400 |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 4 | Subject: [PATCH] Install both binaries and use libdir. |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 8 | |
| 9 | This allows us to build with a shared library for other users while |
| 10 | still providing the normal executable. |
| 11 | |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 12 | Taken from - https://src.fedoraproject.org/rpms/nodejs/raw/rawhide/f/0002-Install-both-binaries-and-use-libdir.patch |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 13 | |
| 14 | Upstream-Status: Pending |
| 15 | |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 16 | Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 17 | Signed-off-by: Andreas MΓΌller <schnitzeltony@gmail.com> |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 19 | --- |
| 20 | configure.py | 7 +++++++ |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 21 | tools/install.py | 21 +++++++++------------ |
| 22 | 2 files changed, 16 insertions(+), 12 deletions(-) |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 23 | |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 24 | diff --git a/configure.py b/configure.py |
| 25 | index e6f7e4db..6cf5c45d 100755 |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 26 | --- a/configure.py |
| 27 | +++ b/configure.py |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 28 | @@ -626,6 +626,12 @@ parser.add_option('--shared', |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 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', |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 41 | @@ -1202,6 +1208,7 @@ def configure_node(o): |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 42 | o['variables']['node_no_browser_globals'] = b(options.no_browser_globals) |
| 43 | |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 44 | o['variables']['node_shared'] = b(options.shared) |
| 45 | + o['variables']['libdir'] = options.libdir |
| 46 | node_module_version = getmoduleversion.get_version() |
| 47 | |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 48 | if options.dest_os == 'android': |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 49 | diff --git a/tools/install.py b/tools/install.py |
| 50 | index 729b416f..9bfc6234 100755 |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 51 | --- a/tools/install.py |
| 52 | +++ b/tools/install.py |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 53 | @@ -121,22 +121,19 @@ def subdir_files(path, dest, action): |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 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') |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 72 | + output_bin = 'node' |
| 73 | + output_lib = 'libnode.' + variables.get('shlib_suffix') |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 74 | |
| 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 Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 79 | + 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') |