diff options
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs/0003-Install-both-binaries-and-use-libdir.patch | 96 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb | 5 |
2 files changed, 100 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0003-Install-both-binaries-and-use-libdir.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0003-Install-both-binaries-and-use-libdir.patch new file mode 100644 index 0000000000..7aa70fec99 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs/0003-Install-both-binaries-and-use-libdir.patch | |||
| @@ -0,0 +1,96 @@ | |||
| 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> | ||
| 18 | |||
| 19 | --- | ||
| 20 | configure.py | 7 +++++++ | ||
| 21 | tools/install.py | 31 ++++++++++++++----------------- | ||
| 22 | 2 files changed, 21 insertions(+), 17 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/configure.py b/configure.py | ||
| 25 | index 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': | ||
| 49 | diff --git a/tools/install.py b/tools/install.py | ||
| 50 | index 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 | -- | ||
| 95 | 2.23.0 | ||
| 96 | |||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb b/meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb index e36995c258..71a47636b0 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_10.17.0.bb | |||
| @@ -17,12 +17,13 @@ COMPATIBLE_HOST_riscv32 = "null" | |||
| 17 | 17 | ||
| 18 | SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | 18 | SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ |
| 19 | file://0001-Disable-running-gyp-files-for-bundled-deps.patch \ | 19 | file://0001-Disable-running-gyp-files-for-bundled-deps.patch \ |
| 20 | file://0003-Install-both-binaries-and-use-libdir.patch \ | ||
| 20 | file://0004-Make-compatibility-with-gcc-4.8.patch \ | 21 | file://0004-Make-compatibility-with-gcc-4.8.patch \ |
| 21 | file://0007-v8-don-t-override-ARM-CFLAGS.patch \ | 22 | file://0007-v8-don-t-override-ARM-CFLAGS.patch \ |
| 22 | " | 23 | " |
| 23 | SRC_URI_append_class-target = " \ | 24 | SRC_URI_append_class-target = " \ |
| 24 | file://0005-Link-atomic-library.patch \ | ||
| 25 | file://0002-Using-native-torque.patch \ | 25 | file://0002-Using-native-torque.patch \ |
| 26 | file://0005-Link-atomic-library.patch \ | ||
| 26 | " | 27 | " |
| 27 | 28 | ||
| 28 | SRC_URI[md5sum] = "d5a56d0abf764a91f627f0690cd4b9f3" | 29 | SRC_URI[md5sum] = "d5a56d0abf764a91f627f0690cd4b9f3" |
| @@ -57,6 +58,7 @@ PACKAGECONFIG[gyp] = ",,gyp-py2-native" | |||
| 57 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" | 58 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" |
| 58 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" | 59 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" |
| 59 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" | 60 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" |
| 61 | PACKAGECONFIG[shared] = "--shared" | ||
| 60 | PACKAGECONFIG[zlib] = "--shared-zlib,,zlib" | 62 | PACKAGECONFIG[zlib] = "--shared-zlib,,zlib" |
| 61 | 63 | ||
| 62 | # We don't want to cross-compile during target compile, | 64 | # We don't want to cross-compile during target compile, |
| @@ -99,6 +101,7 @@ do_configure () { | |||
| 99 | ./configure --prefix=${prefix} --without-snapshot --shared-openssl \ | 101 | ./configure --prefix=${prefix} --without-snapshot --shared-openssl \ |
| 100 | --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ | 102 | --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ |
| 101 | --dest-os=linux \ | 103 | --dest-os=linux \ |
| 104 | --libdir=${D}${libdir} \ | ||
| 102 | ${ARCHFLAGS} \ | 105 | ${ARCHFLAGS} \ |
| 103 | ${PACKAGECONFIG_CONFARGS} | 106 | ${PACKAGECONFIG_CONFARGS} |
| 104 | } | 107 | } |
