Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 1 | From 5bfeffdf4b5de1c60a2ff0d1ddf65db2bb9a1533 Mon Sep 17 00:00:00 2001 |
| 2 | From: Elliott Sales de Andrade <quantum.analyst@gmail.com> |
| 3 | Date: Tue, 19 Mar 2019 23:22:40 -0400 |
| 4 | Subject: [PATCH 3/3] Install both binaries and use libdir. |
| 5 | |
| 6 | This allows us to build with a shared library for other users while |
| 7 | still providing the normal executable. |
| 8 | |
| 9 | Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> |
| 10 | |
| 11 | Stolen from [1] |
| 12 | |
| 13 | [1] https://src.fedoraproject.org/rpms/nodejs/raw/master/f/0003-Install-both-binaries-and-use-libdir.patch |
| 14 | |
| 15 | Upstream-Status: Pending |
| 16 | |
| 17 | Signed-off-by: Andreas MΓΌller <schnitzeltony@gmail.com> |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 18 | --- |
| 19 | configure.py | 7 +++++++ |
| 20 | tools/install.py | 31 ++++++++++++++----------------- |
| 21 | 2 files changed, 21 insertions(+), 17 deletions(-) |
| 22 | |
| 23 | diff --git a/configure.py b/configure.py |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 24 | index 20cce214db..e2d78a2a51 100755 |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 25 | --- a/configure.py |
| 26 | +++ b/configure.py |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | @@ -559,6 +559,12 @@ parser.add_option('--shared', |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 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_option('--libdir', |
| 32 | + action='store', |
| 33 | + dest='libdir', |
| 34 | + default='lib', |
| 35 | + help='a directory to install the shared library into') |
| 36 | + |
| 37 | parser.add_option('--without-v8-platform', |
| 38 | action='store_true', |
| 39 | dest='without_v8_platform', |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 40 | @@ -1103,6 +1109,7 @@ def configure_node(o): |
| 41 | if o['variables']['want_separate_host_toolset'] == 0: |
| 42 | o['variables']['node_code_cache'] = 'yes' # For testing |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 43 | o['variables']['node_shared'] = b(options.shared) |
| 44 | + o['variables']['libdir'] = options.libdir |
| 45 | node_module_version = getmoduleversion.get_version() |
| 46 | |
| 47 | if sys.platform == 'darwin': |
| 48 | diff --git a/tools/install.py b/tools/install.py |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 49 | index 655802980a..fe4723bf15 100755 |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 50 | --- a/tools/install.py |
| 51 | +++ b/tools/install.py |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 52 | @@ -121,26 +121,23 @@ def subdir_files(path, dest, action): |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 53 | |
| 54 | def files(action): |
| 55 | is_windows = sys.platform == 'win32' |
| 56 | - output_file = 'node' |
| 57 | output_prefix = 'out/Release/' |
| 58 | + output_libprefix = output_prefix |
| 59 | |
| 60 | - if 'false' == variables.get('node_shared'): |
| 61 | - if is_windows: |
| 62 | - output_file += '.exe' |
| 63 | + if is_windows: |
| 64 | + output_bin = 'node.exe' |
| 65 | + output_lib = 'node.dll' |
| 66 | else: |
| 67 | - if is_windows: |
| 68 | - output_file += '.dll' |
| 69 | - else: |
| 70 | - output_file = 'lib' + output_file + '.' + variables.get('shlib_suffix') |
| 71 | - # GYP will output to lib.target except on OS X, this is hardcoded |
| 72 | - # in its source - see the _InstallableTargetInstallPath function. |
| 73 | - if sys.platform != 'darwin': |
| 74 | - output_prefix += 'lib.target/' |
| 75 | - |
| 76 | - if 'false' == variables.get('node_shared'): |
| 77 | - action([output_prefix + output_file], 'bin/' + output_file) |
| 78 | - else: |
| 79 | - action([output_prefix + output_file], 'lib/' + output_file) |
| 80 | + output_bin = 'node' |
| 81 | + output_lib = 'libnode.' + variables.get('shlib_suffix') |
| 82 | + # GYP will output to lib.target except on OS X, this is hardcoded |
| 83 | + # in its source - see the _InstallableTargetInstallPath function. |
| 84 | + if sys.platform != 'darwin': |
| 85 | + output_libprefix += 'lib.target/' |
| 86 | + |
| 87 | + action([output_prefix + output_bin], 'bin/' + output_bin) |
| 88 | + if 'true' == variables.get('node_shared'): |
| 89 | + action([output_libprefix + output_lib], variables.get('libdir') + '/' + output_lib) |
| 90 | |
| 91 | if 'true' == variables.get('node_use_dtrace'): |
| 92 | action(['out/Release/node.d'], 'lib/dtrace/node.d') |
| 93 | -- |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 94 | 2.20.1 |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 95 | |