From cfd68734933cdf1db421cba48bb56f44844156ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Tue, 31 May 2022 13:30:35 +0200 Subject: [PATCH] Patch node.gyp in place of leaving OpenSSL bits in place --- 0001-Disable-running-gyp-on-shared-deps.patch | 48 ++++++++++++++----- ...Install-both-binaries-and-use-libdir.patch | 29 ++++------- nodejs-sources.sh | 6 +-- sources | 2 +- 4 files changed, 49 insertions(+), 36 deletions(-) diff --git a/0001-Disable-running-gyp-on-shared-deps.patch b/0001-Disable-running-gyp-on-shared-deps.patch index 08d39b6..459e673 100644 --- a/0001-Disable-running-gyp-on-shared-deps.patch +++ b/0001-Disable-running-gyp-on-shared-deps.patch @@ -1,19 +1,19 @@ -From 221a54bccf0c373abe711553e5d5a1887c9650bf Mon Sep 17 00:00:00 2001 +From 3ac2a9a2ef115a3375162f2abfd26d5cf3f2ee98 Mon Sep 17 00:00:00 2001 From: Zuzana Svetlikova Date: Fri, 17 Apr 2020 12:59:44 +0200 -Subject: [PATCH 1/2] Disable running gyp on shared deps +Subject: [PATCH] Disable running gyp on shared deps +Signed-off-by: rpm-build --- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + Makefile | 2 +- + node.gyp | 17 ----------------- + 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/Makefile b/Makefile -index 4aace77c7c8c63c652755b4e1d03be51eb53131e..0bad86420d64762f2df225aa2e070befd5801612 100644 +index 4aace77..0bad864 100644 --- a/Makefile +++ b/Makefile -@@ -145,11 +145,11 @@ endif - .PHONY: test-code-cache - with-code-cache test-code-cache: +@@ -147,7 +147,7 @@ with-code-cache test-code-cache: $(warning '$@' target is a noop) out/Makefile: config.gypi common.gypi node.gyp \ @@ -22,8 +22,34 @@ index 4aace77c7c8c63c652755b4e1d03be51eb53131e..0bad86420d64762f2df225aa2e070bef tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \ tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp $(PYTHON) tools/gyp_node.py -f make - - # node_version.h is listed because the N-API version is taken from there +diff --git a/node.gyp b/node.gyp +index 86fe9a6..bfa5093 100644 +--- a/node.gyp ++++ b/node.gyp +@@ -449,23 +449,6 @@ + ], + }, + ], +- }, { +- 'variables': { +- 'opensslconfig_internal': '<(obj_dir)/deps/openssl/openssl.cnf', +- 'opensslconfig': './deps/openssl/openssl/apps/openssl.cnf', +- }, +- 'actions': [ +- { +- 'action_name': 'reset_openssl_cnf', +- 'inputs': [ '<(opensslconfig)', ], +- 'outputs': [ '<(opensslconfig_internal)', ], +- 'action': [ +- 'python', 'tools/copyfile.py', +- './deps/openssl/openssl/apps/openssl.cnf', +- '<(obj_dir)/deps/openssl/openssl.cnf', +- ], +- }, +- ], + }], + ], + }, # node_core_target_name -- -2.35.1 +2.36.1 diff --git a/0002-Install-both-binaries-and-use-libdir.patch b/0002-Install-both-binaries-and-use-libdir.patch index 02355d3..149d6bc 100644 --- a/0002-Install-both-binaries-and-use-libdir.patch +++ b/0002-Install-both-binaries-and-use-libdir.patch @@ -1,25 +1,24 @@ -From 9f8cd8f9ef8a9466e7d315cdf05fb24eab2678b8 Mon Sep 17 00:00:00 2001 +From 6d789d036cf7d997b335d07f19b60c95577ea6e2 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 19 Mar 2019 23:22:40 -0400 -Subject: [PATCH 2/2] Install both binaries and use libdir. +Subject: [PATCH] Install both binaries and use libdir. This allows us to build with a shared library for other users while still providing the normal executable. Signed-off-by: Elliott Sales de Andrade Signed-off-by: Stephen Gallagher +Signed-off-by: rpm-build --- configure.py | 7 +++++++ tools/install.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py -index 17ff53ef645493c8090e809b021e1127a07921cd..ad952f6a063d433a76065162baccdca2bab71fbf 100755 +index 17ff53e..ad952f6 100755 --- a/configure.py +++ b/configure.py -@@ -727,10 +727,16 @@ parser.add_argument('--shared', - dest='shared', - default=None, +@@ -729,6 +729,12 @@ parser.add_argument('--shared', help='compile shared library for embedding node in another project. ' + '(This mode is not officially supported for regular applications)') @@ -32,11 +31,7 @@ index 17ff53ef645493c8090e809b021e1127a07921cd..ad952f6a063d433a76065162baccdca2 parser.add_argument('--without-v8-platform', action='store_true', dest='without_v8_platform', - default=False, - help='do not initialize v8 platform during node.js startup. ' + -@@ -1364,10 +1370,11 @@ def configure_node(o): - o['variables']['debug_nghttp2'] = 'false' - +@@ -1366,6 +1372,7 @@ def configure_node(o): o['variables']['node_no_browser_globals'] = b(options.no_browser_globals) o['variables']['node_shared'] = b(options.shared) @@ -44,15 +39,11 @@ index 17ff53ef645493c8090e809b021e1127a07921cd..ad952f6a063d433a76065162baccdca2 node_module_version = getmoduleversion.get_version() if options.dest_os == 'android': - shlib_suffix = 'so' - elif sys.platform == 'darwin': diff --git a/tools/install.py b/tools/install.py -index 47e9d8bd7a1ae596a7c6e1d5917f538e81533726..c1afbbf0827ced2e166668e7932504687009bb9e 100755 +index 47e9d8b..c1afbbf 100755 --- a/tools/install.py +++ b/tools/install.py -@@ -141,11 +141,11 @@ def files(action): - if is_windows: - action([output_prefix + 'libnode.dll'], 'bin/libnode.dll') +@@ -143,7 +143,7 @@ def files(action): action([output_prefix + 'libnode.lib'], 'lib/libnode.lib') else: output_lib = 'libnode.' + variables.get('shlib_suffix') @@ -61,8 +52,6 @@ index 47e9d8bd7a1ae596a7c6e1d5917f538e81533726..c1afbbf0827ced2e166668e793250468 if 'true' == variables.get('node_use_dtrace'): action(['out/Release/node.d'], 'lib/dtrace/node.d') - # behave similarly for systemtap - action(['src/node.stp'], 'share/systemtap/tapset/') -- -2.35.1 +2.36.1 diff --git a/nodejs-sources.sh b/nodejs-sources.sh index a08d124..645b8c1 100755 --- a/nodejs-sources.sh +++ b/nodejs-sources.sh @@ -126,11 +126,9 @@ wget http://nodejs.org/dist/v${version}/node-v${version}.tar.gz \ sha256sum -c SHASUMS256.txt --ignore-missing tar -zxf node-v${version}.tar.gz -# Exclude problematic OpenSSL bits +# Remove bundled OpenSSL # We will link to the system version -rm -rf node-v${version}/deps/openssl/demos node-v${version}/deps/openssl/test -# Remove every file except the OpenSSL config files -find node-v${version}/deps/openssl/ ! -name "*.cnf" -type f -exec rm -f {} \; +rm -rf node-v${version}/deps/openssl tar -zcf node-v${version}-stripped.tar.gz node-v${version} ICU_MAJOR=$(jq -r '.[0].url' node-v${version}/tools/icu/current_ver.dep | sed --expression='s/.*release-\([[:digit:]]\+\)-\([[:digit:]]\+\).*/\1/g') diff --git a/sources b/sources index cce7e95..e4960a9 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (node-v18.2.0-stripped.tar.gz) = 9884b0f878cc9fea819626611b099c3d299b750f43b6792c3787ed1829dc8613d14d7a94f0c917b07eda352f98c5ec6f9191f15a72906daa9687ddc44cc3e82b +SHA512 (node-v18.2.0-stripped.tar.gz) = 1aa760627b56f0da7f4357d7e726cfa0abb66639716717636522dbfa85a8793c15eb3bfea9854b0f80a5e84b68c44ec443beb8d80db4dcbfb1e446331378aa23 SHA512 (icu4c-71_1-data-bin-b.zip) = 2bee9b93699c40a53c2e768d4678309fbd49e052e197a80fb76842b4001ee65e548459654ef7e7d154b6289f915fccbcb5b3109edcd61e74f0db289f2bec61fd SHA512 (icu4c-71_1-data-bin-l.zip) = 07a299b1cd37cd7b07c5e1a7c6871c0dbbeabb2dec6e11c89237f41e56fd29e1a65725be102b4e4ab722183c02810a5df3ed47c3b9b4a7c14bc4c72ab127a27e