From 45296320d16595de65237c13d5781ed8f368ccf2 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 27 Jul 2022 15:00:21 -0400 Subject: [PATCH] Update to 18.7.0 Add bcond to disable building the included npm. Signed-off-by: Stephen Gallagher --- 0001-Disable-running-gyp-on-shared-deps.patch | 8 +++---- ...Install-both-binaries-and-use-libdir.patch | 8 +++---- nodejs.spec | 23 ++++++++++++++++--- sources | 2 +- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/0001-Disable-running-gyp-on-shared-deps.patch b/0001-Disable-running-gyp-on-shared-deps.patch index ef93fce..626114d 100644 --- a/0001-Disable-running-gyp-on-shared-deps.patch +++ b/0001-Disable-running-gyp-on-shared-deps.patch @@ -1,4 +1,4 @@ -From 5f4369b4448337c034067744711b02a496cb3d39 Mon Sep 17 00:00:00 2001 +From dd53d0b72ade3b5b391cb99d7393658b7e24c91c 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 @@ -10,7 +10,7 @@ Signed-off-by: rpm-build 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/Makefile b/Makefile -index 9f7ab7129d06471760c707a4bf7764cb2bdff862..78f91cf7f57b0de32961b1d491edf28a4ad375d2 100644 +index e0d756fea3ac356041ecdea678c4628fa8b76de2..c90bfa76231397ea2328613d6335cef0ac784f0f 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ with-code-cache test-code-cache: @@ -23,10 +23,10 @@ index 9f7ab7129d06471760c707a4bf7764cb2bdff862..78f91cf7f57b0de32961b1d491edf28a tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp $(PYTHON) tools/gyp_node.py -f make diff --git a/node.gyp b/node.gyp -index 340ffc27ade9f73c1a5b4121bd9184a1fc3976a9..dfed3734eb52936c6e56ae6df533ca94150c7f69 100644 +index e8227bb22a39fe75eab9c66ad85e1a3579d7628d..6db3c5d1783a3c1b9e2ae283d97b78c531ba862a 100644 --- a/node.gyp +++ b/node.gyp -@@ -423,23 +423,6 @@ +@@ -429,23 +429,6 @@ ], }, ], diff --git a/0002-Install-both-binaries-and-use-libdir.patch b/0002-Install-both-binaries-and-use-libdir.patch index a43085f..ef775fe 100644 --- a/0002-Install-both-binaries-and-use-libdir.patch +++ b/0002-Install-both-binaries-and-use-libdir.patch @@ -1,4 +1,4 @@ -From 19844592f46490cd7cff5f58aca73a64a992fb42 Mon Sep 17 00:00:00 2001 +From 2fffabf30b24a7237c17a57704a8e99d425e98f5 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. @@ -40,11 +40,11 @@ index e53a83f332ffd60cf7b6fe7e079470a52a43a8de..efdda6afce33201976e3811907bf4d7e if options.dest_os == 'android': diff --git a/tools/install.py b/tools/install.py -index 47e9d8bd7a1ae596a7c6e1d5917f538e81533726..c1afbbf0827ced2e166668e7932504687009bb9e 100755 +index 5793b581f774db9e2c06495792eb35a3c2f34047..fe16c2bd1f4890919908c7e508451891fce86d0c 100755 --- a/tools/install.py +++ b/tools/install.py -@@ -143,7 +143,7 @@ def files(action): - action([output_prefix + 'libnode.lib'], 'lib/libnode.lib') +@@ -176,7 +176,7 @@ def files(action): + try_symlink(so_name, link_path) else: output_lib = 'libnode.' + variables.get('shlib_suffix') - action([output_prefix + output_lib], 'lib/' + output_lib) diff --git a/nodejs.spec b/nodejs.spec index cf4a08a..9d8fbc1 100644 --- a/nodejs.spec +++ b/nodejs.spec @@ -28,6 +28,7 @@ %bcond_with bundled_zlib %endif +%bcond npm 1 # LTO is currently broken on Node.js builds %define _lto_cflags %{nil} @@ -51,7 +52,7 @@ # than a Fedora release lifecycle. %global nodejs_epoch 1 %global nodejs_major 18 -%global nodejs_minor 6 +%global nodejs_minor 7 %global nodejs_patch 0 %global nodejs_abi %{nodejs_major}.%{nodejs_minor} # nodejs_soversion - from NODE_MODULE_VERSION in src/node_version.h @@ -109,7 +110,7 @@ # npm - from deps/npm/package.json %global npm_epoch 1 -%global npm_version 8.13.2 +%global npm_version 8.15.0 # In order to avoid needing to keep incrementing the release version for the # main package forever, we will just construct one for npm that is guaranteed @@ -364,7 +365,7 @@ Conflicts: v8-314-devel %description -n v8-devel Development headers for the v8 runtime. - +%if %{with npm} %package -n npm Summary: Node.js Package Manager Epoch: %{npm_epoch} @@ -387,6 +388,7 @@ Provides: npm(npm) = %{npm_version} %description -n npm npm is a package manager for node.js. You can use it to install and publish your node programs. It manages dependencies and does other cool stuff. +%endif %package docs @@ -481,6 +483,7 @@ export LDFLAGS="%{build_ldflags}" --with-intl=small-icu \ --with-icu-default-data-dir=%{icudatadir} \ --without-corepack \ + %{!?with_npm:--without-npm} \ --openssl-use-def-ca-store %ninja_build -C out/Release @@ -540,6 +543,8 @@ mv %{buildroot}%{_includedir}/node/config.gypi \ # Install the GDB init tool into the documentation directory mv %{buildroot}/%{_datadir}/doc/node/gdbinit %{buildroot}/%{_pkgdocdir}/gdbinit + +%if %{with npm} # install NPM docs to mandir mkdir -p %{buildroot}%{_mandir} \ %{buildroot}%{_pkgdocdir}/npm @@ -548,11 +553,13 @@ cp -pr deps/npm/man/* %{buildroot}%{_mandir}/ rm -rf %{buildroot}%{_prefix}/lib/node_modules/npm/man ln -srf %{_mandir} %{buildroot}%{_prefix}/lib/node_modules/npm/man + # Install Gatsby HTML documentation to %%{_pkgdocdir} cp -pr deps/npm/docs %{buildroot}%{_pkgdocdir}/npm/ rm -rf %{buildroot}%{_prefix}/lib/node_modules/npm/docs ln -srf %{_pkgdocdir}/npm %{buildroot}%{_prefix}/lib/node_modules/npm/docs +%endif # Node tries to install some python files into a documentation directory # (and not the proper one). Remove them for now until we figure out what to @@ -560,6 +567,8 @@ ln -srf %{_pkgdocdir}/npm %{buildroot}%{_prefix}/lib/node_modules/npm/docs rm -f %{buildroot}/%{_defaultdocdir}/node/lldb_commands.py \ %{buildroot}/%{_defaultdocdir}/node/lldbinit + +%if %{with npm} # Some NPM bundled deps are executable but should not be. This causes # unnecessary automatic dependencies to be added. Make them not executable. # Skip the npm bin directory or the npm binary will not work. @@ -580,6 +589,7 @@ cp %{SOURCE1} %{buildroot}%{_sysconfdir}/npmrc # This is done in the interests of keeping /usr read-only. mkdir -p %{buildroot}%{_prefix}/etc ln -rs %{_sysconfdir}/npmrc %{buildroot}%{_prefix}/etc/npmrc +%endif # Install the full-icu data files mkdir -p %{buildroot}%{icudatadir} @@ -599,8 +609,10 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/%{_bindir}/node -e "require( # Ensure we have punycode and that the version matches LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/%{_bindir}/node -e "require(\"assert\").equal(require(\"punycode\").version, '%{punycode_version}')" +%if %{with npm} # Ensure we have npm and that the version matches LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/node %{buildroot}%{_bindir}/npm version --json |jq -e '.npm == "%{npm_version}"' +%endif # Make sure i18n support is working NODE_PATH=%{buildroot}%{_prefix}/lib/node_modules:%{buildroot}%{_prefix}/lib/node_modules/npm/node_modules LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/%{_bindir}/node --icu-data-dir=%{buildroot}%{icudatadir} %{SOURCE2} @@ -671,6 +683,7 @@ end %{_libdir}/libv8_libplatform.so +%if %{with npm} %files -n npm %{_bindir}/npm %{_bindir}/npx @@ -696,13 +709,17 @@ end %doc %{_mandir}/man7/scope.7* %doc %{_mandir}/man7/scripts.7* %doc %{_mandir}/man7/workspaces.7* +%endif %files docs %doc doc %dir %{_pkgdocdir} %{_pkgdocdir}/html + +%if %{with npm} %{_pkgdocdir}/npm/docs +%endif %changelog diff --git a/sources b/sources index 705581d..39e901a 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (node-v18.6.0-stripped.tar.gz) = 5e07678fc8c22755a72eba6af34ebe76e8bfd28cfdba3701afa3a34c980bceb1914372711eaaf4906e70e115cceb494b6f57b0316604a54113d9c9cea3d10cc6 +SHA512 (node-v18.7.0-stripped.tar.gz) = 2f5685b082bdc6b2de97318c5905b57600252eaf977a3a523964dcb625d5564fc11a6b58c7e9f5029c316857aa889bf4f0bd97835bb7695920bba94563cd9667 SHA512 (icu4c-71_1-data-bin-b.zip) = 2bee9b93699c40a53c2e768d4678309fbd49e052e197a80fb76842b4001ee65e548459654ef7e7d154b6289f915fccbcb5b3109edcd61e74f0db289f2bec61fd SHA512 (icu4c-71_1-data-bin-l.zip) = 07a299b1cd37cd7b07c5e1a7c6871c0dbbeabb2dec6e11c89237f41e56fd29e1a65725be102b4e4ab722183c02810a5df3ed47c3b9b4a7c14bc4c72ab127a27e