From 27ec2a16cf7297caa42a17ae3c51553c4a13e669 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Wed, 25 Jan 2023 12:03:50 +0000 Subject: [PATCH 1/4] - Again use openssl-3, if available. OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs18?expand=0&rev=37 --- nodejs18.changes | 5 +++++ nodejs18.spec | 18 +++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/nodejs18.changes b/nodejs18.changes index b26c7fb..340a1e3 100644 --- a/nodejs18.changes +++ b/nodejs18.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jan 25 12:01:18 UTC 2023 - Adam Majer + +- Again use openssl-3, if available. + ------------------------------------------------------------------- Mon Jan 16 14:57:58 UTC 2023 - Adam Majer diff --git a/nodejs18.spec b/nodejs18.spec index 1ff04ca..8f3f37c 100644 --- a/nodejs18.spec +++ b/nodejs18.spec @@ -82,7 +82,7 @@ Release: 0 %define _libexecdir %{_exec_prefix}/lib %endif -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 120500 || 0%{?fedora_version} >= 35 +%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 120400 || 0%{?fedora_version} >= 35 %bcond_with intree_openssl %else %bcond_without intree_openssl @@ -266,8 +266,7 @@ BuildRequires: group(nobody) %if ! 0%{with intree_openssl} -BuildRequires: libopenssl-1_1-devel -#BuildRequires: (pkgconfig(openssl) >= %{openssl_req_ver} and pkgconfig(openssl) < 3.0) +BuildRequires: pkgconfig(openssl) >= %{openssl_req_ver} # require patched openssl library on SLES for nodejs16 %if 0%{?suse_version} && "%{pkg_version openssl-1_1}" != "~~~" @@ -278,13 +277,18 @@ Requires: openssl-has-RSA_get0_pss_params %endif %if 0%{?suse_version} -#%if 0%{?suse_version} >= 1500 -#iBuildRequires: openssl >= %{openssl_req_ver} -#%else +%if 0%{?suse_version} >= 1500 +BuildRequires: openssl >= %{openssl_req_ver} +%else BuildRequires: openssl-1_1 >= %{openssl_req_ver} -#%endif +%endif +%if %{pkg_vcmp openssl > '3.0' } +BuildRequires: libopenssl3-hmac +%else BuildRequires: libopenssl1_1-hmac +%endif + # /suse_version %endif From d2fd477a39caabaaec625a43dbb3e27480e00fbb Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Wed, 25 Jan 2023 12:41:48 +0000 Subject: [PATCH 2/4] - _constraints: reset aarch64 memory requirements back to original otherwise some unit tests can fail OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs18?expand=0&rev=38 --- _constraints | 3 --- nodejs18.changes | 2 ++ nodejs18.spec | 7 ++++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/_constraints b/_constraints index fd0fd96..16f8e04 100644 --- a/_constraints +++ b/_constraints @@ -16,9 +16,6 @@ asimdrdm - - 6 - diff --git a/nodejs18.changes b/nodejs18.changes index 340a1e3..d372b5f 100644 --- a/nodejs18.changes +++ b/nodejs18.changes @@ -2,6 +2,8 @@ Wed Jan 25 12:01:18 UTC 2023 - Adam Majer - Again use openssl-3, if available. +- _constraints: reset aarch64 memory requirements back to original + otherwise some unit tests can fail ------------------------------------------------------------------- Mon Jan 16 14:57:58 UTC 2023 - Adam Majer diff --git a/nodejs18.spec b/nodejs18.spec index 8f3f37c..27356fc 100644 --- a/nodejs18.spec +++ b/nodejs18.spec @@ -264,6 +264,7 @@ BuildRequires: user(nobody) BuildRequires: group(nobody) %endif +# shared openssl %if ! 0%{with intree_openssl} BuildRequires: pkgconfig(openssl) >= %{openssl_req_ver} @@ -277,13 +278,14 @@ Requires: openssl-has-RSA_get0_pss_params %endif %if 0%{?suse_version} + %if 0%{?suse_version} >= 1500 BuildRequires: openssl >= %{openssl_req_ver} %else BuildRequires: openssl-1_1 >= %{openssl_req_ver} %endif -%if %{pkg_vcmp openssl > '3.0' } +%if %{pkg_vcmp pkgconfig(openssl) > '3.0' } BuildRequires: libopenssl3-hmac %else BuildRequires: libopenssl1_1-hmac @@ -297,11 +299,14 @@ BuildRequires: openssl >= %{openssl_req_ver} %endif %else +# bundled openssl %if %node_version_number <= 12 && 0%{?suse_version} == 1315 && 0%{?sle_version} < 120400 Provides: bundled(openssl) = 3.0.7 %else BuildRequires: bundled_openssl_should_not_be_required %endif + +# /bundled openssl %endif %if ! 0%{with intree_cares} From 65a950dd73a02809f866df920d5441ac9fdbeb3a Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Thu, 26 Jan 2023 12:59:22 +0000 Subject: [PATCH 3/4] - s390.patch: fix unit test on s390 with patched zlib OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs18?expand=0&rev=39 --- nodejs18.changes | 1 + nodejs18.spec | 63 +++++++++++++++++++----------------------------- s390.patch | 28 +++++++++++++++++++++ 3 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 s390.patch diff --git a/nodejs18.changes b/nodejs18.changes index d372b5f..b5c09b7 100644 --- a/nodejs18.changes +++ b/nodejs18.changes @@ -4,6 +4,7 @@ Wed Jan 25 12:01:18 UTC 2023 - Adam Majer - Again use openssl-3, if available. - _constraints: reset aarch64 memory requirements back to original otherwise some unit tests can fail +- s390.patch: fix unit test on s390 with patched zlib ------------------------------------------------------------------- Mon Jan 16 14:57:58 UTC 2023 - Adam Majer diff --git a/nodejs18.spec b/nodejs18.spec index 27356fc..7fa427d 100644 --- a/nodejs18.spec +++ b/nodejs18.spec @@ -1,7 +1,7 @@ # # spec file for package nodejs18 # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,17 +15,7 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # -########################################################### -# -# WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! -# -# This spec file is generated from a template hosted at -# https://github.com/AdamMajer/nodejs-packaging -# -########################################################### -# Fedora doesn't have rpm-config-SUSE which provides -# ext_man in /usr/lib/rpm/macros.d/macros.obs %if 0%{?fedora_version} %define ext_man .gz %endif @@ -129,12 +119,12 @@ Source1: https://nodejs.org/dist/v%{version}/SHASUMS256.txt Source2: https://nodejs.org/dist/v%{version}/SHASUMS256.txt.sig Source3: nodejs.keyring -# Python 3.4 compatible node-gyp -### https://github.com/nodejs/node-gyp.git -### git archive v7.1.2 | xz > node-gyp_7.1.2.tar.xz -Source5: node-gyp_7.1.2.tar.xz -# Only required to run unit tests in NodeJS 10+ -Source10: update_npm_tarball.sh +# Python 3.4 compatible node-gyp +### https://github.com/nodejs/node-gyp.git +### git archive v7.1.2 | xz > node-gyp_7.1.2.tar.xz +Source5: node-gyp_7.1.2.tar.xz +# Only required to run unit tests in NodeJS 10+ +Source10: update_npm_tarball.sh Source11: node_modules.tar.xz Source20: bash_output_helper.bash @@ -145,8 +135,6 @@ Patch5: sle12_python3_compat.patch Patch7: manual_configure.patch Patch13: openssl_binary_detection.patch - - ## Patches specific to SUSE and openSUSE Patch100: linker_lto_jobs.patch # PATCH-FIX-OPENSUSE -- set correct path for dtrace if it is built @@ -171,9 +159,10 @@ Patch133: rsa-pss-revert.patch Patch200: versioned.patch Patch305: qemu_timeouts_arches.patch +Patch307: s390.patch -BuildRequires: pkg-config BuildRequires: fdupes +BuildRequires: pkg-config BuildRequires: procps BuildRequires: xz BuildRequires: zlib-devel @@ -193,10 +182,10 @@ BuildRequires: config(netcfg) %if 0%{?suse_version} == 1110 # GCC 5 is only available in the SUSE:SLE-11:SP4:Update repository (SDK). %if %node_version_number >= 8 -BuildRequires: gcc5-c++ +BuildRequires: gcc5-c++ %define forced_gcc_version 5 %else -BuildRequires: gcc48-c++ +BuildRequires: gcc48-c++ %define forced_gcc_version 4.8 %endif %endif @@ -206,15 +195,15 @@ BuildRequires: gcc48-c++ # for SLE-12:Update targets %if 0%{?suse_version} == 1315 %if %node_version_number >= 17 -BuildRequires: gcc12-c++ +BuildRequires: gcc12-c++ %define forced_gcc_version 12 %else %if %node_version_number >= 14 -BuildRequires: gcc9-c++ +BuildRequires: gcc9-c++ %define forced_gcc_version 9 %else %if %node_version_number >= 8 -BuildRequires: gcc7-c++ +BuildRequires: gcc7-c++ %define forced_gcc_version 7 %endif %endif @@ -223,7 +212,7 @@ BuildRequires: gcc7-c++ %if 0%{?suse_version} == 1500 %if %node_version_number >= 17 -BuildRequires: gcc12-c++ +BuildRequires: gcc12-c++ %define forced_gcc_version 12 %endif %endif @@ -234,7 +223,6 @@ BuildRequires: gcc12-c++ BuildRequires: gcc-c++ %endif - # Python dependencies %if %node_version_number >= 16 @@ -260,8 +248,8 @@ BuildRequires: python %endif %if 0%{?suse_version} >= 1500 && %{node_version_number} >= 10 -BuildRequires: user(nobody) BuildRequires: group(nobody) +BuildRequires: user(nobody) %endif # shared openssl @@ -334,7 +322,7 @@ BuildRequires: valgrind %if %{with libalternatives} Requires: alts %else -Requires(postun): %{_sbindir}/update-alternatives +Requires(postun):%{_sbindir}/update-alternatives %endif # either for update-alternatives, or their removal Requires(post): %{_sbindir}/update-alternatives @@ -373,8 +361,8 @@ ExclusiveArch: not_buildable %endif %endif -Provides: bundled(uvwasi) = 0.0.13 Provides: bundled(libuv) = 1.44.2 +Provides: bundled(uvwasi) = 0.0.13 Provides: bundled(v8) = 10.2.154.23 %if %{with intree_brotli} Provides: bundled(brotli) = 1.0.9 @@ -382,10 +370,9 @@ Provides: bundled(brotli) = 1.0.9 BuildRequires: pkgconfig(libbrotlidec) %endif - +Provides: bundled(base64) = 0.5.0 Provides: bundled(llhttp) = 6.0.10 Provides: bundled(ngtcp2) = 0.8.1 -Provides: bundled(base64) = 0.5.0 Provides: bundled(node-acorn) = 8.8.1 @@ -405,8 +392,8 @@ provided by npm. Summary: Development headers for NodeJS 18.x Group: Development/Languages/NodeJS Provides: nodejs-devel = %{version} -Requires: npm18 = %{version} Requires: %{name} = %{version} +Requires: npm18 = %{version} %description devel This package provides development headers for Node.js needed for creation @@ -423,12 +410,12 @@ Requires: nodejs-common Requires: nodejs18 = %{version} Provides: nodejs-npm = %{version} Obsoletes: nodejs-npm < 4.0.0 -Provides: npm(npm) = 8.19.3 Provides: npm = %{version} +Provides: npm(npm) = 8.19.3 %if 0%{?suse_version} >= 1500 %if %{node_version_number} >= 10 -Requires: user(nobody) Requires: group(nobody) +Requires: user(nobody) %endif %endif Provides: bundled(node-abbrev) = 1.1.1 @@ -594,8 +581,8 @@ Provides: bundled(node-spdx-exceptions) = 2.3.0 Provides: bundled(node-spdx-expression-parse) = 3.0.1 Provides: bundled(node-spdx-license-ids) = 3.0.11 Provides: bundled(node-ssri) = 9.0.1 -Provides: bundled(node-string_decoder) = 1.3.0 Provides: bundled(node-string-width) = 4.2.3 +Provides: bundled(node-string_decoder) = 1.3.0 Provides: bundled(node-strip-ansi) = 6.0.1 Provides: bundled(node-supports-color) = 7.2.0 Provides: bundled(node-tar) = 6.1.11 @@ -693,6 +680,7 @@ popd %patch200 -p1 %patch305 -p1 +%patch307 -p1 %if %{node_version_number} <= 12 # minimist security update - patch50 @@ -706,8 +694,6 @@ find -name \*~ -print0 -delete # abnormalities from patching find \( -name \*.js.orig -or -name \*.md.orig -or -name \*.1.orig \) -delete - - %build # normalize shebang %if %{node_version_number} >= 12 @@ -1062,6 +1048,7 @@ update-alternatives --remove npm-default %{_bindir}/npm%{node_version_number} update-alternatives --remove npx-default %{_bindir}/npx%{node_version_number} %else + %pre # remove files that are no longer owned but provided by update-alternatives if ! [ -L %{_mandir}/man1/node.1%{ext_man} ]; then diff --git a/s390.patch b/s390.patch new file mode 100644 index 0000000..985424f --- /dev/null +++ b/s390.patch @@ -0,0 +1,28 @@ +Index: node-v18.13.0/test/parallel/test-whatwg-webstreams-compression.js +=================================================================== +--- node-v18.13.0.orig/test/parallel/test-whatwg-webstreams-compression.js ++++ node-v18.13.0/test/parallel/test-whatwg-webstreams-compression.js +@@ -20,11 +20,19 @@ async function test(format) { + const reader = gunzip.readable.getReader(); + const writer = gzip.writable.getWriter(); + ++ let compressed_data = []; ++ const reader_function = ({ value, done }) => { ++ if (value) ++ compressed_data.push(value); ++ if (!done) ++ return reader.read().then(reader_function); ++ assert.strictEqual(dec.decode(Buffer.concat(compressed_data)), 'hello'); ++ }; ++ const reader_promise = reader.read().then(reader_function); ++ + await Promise.all([ +- reader.read().then(({ value, done }) => { +- assert.strictEqual(dec.decode(value), 'hello'); +- }), +- reader.read().then(({ done }) => assert(done)), ++ reader_promise, ++ reader_promise.then(() => reader.read().then(({ done }) => assert(done))), + writer.write('hello'), + writer.close(), + ]); From 86eb1da432dcbc1141cc22524606103f4306f765 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Thu, 26 Jan 2023 13:00:15 +0000 Subject: [PATCH 4/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs18?expand=0&rev=40 --- nodejs18.spec | 61 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/nodejs18.spec b/nodejs18.spec index 7fa427d..489fa34 100644 --- a/nodejs18.spec +++ b/nodejs18.spec @@ -1,7 +1,7 @@ # # spec file for package nodejs18 # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,7 +15,17 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # +########################################################### +# +# WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! +# +# This spec file is generated from a template hosted at +# https://github.com/AdamMajer/nodejs-packaging +# +########################################################### +# Fedora doesn't have rpm-config-SUSE which provides +# ext_man in /usr/lib/rpm/macros.d/macros.obs %if 0%{?fedora_version} %define ext_man .gz %endif @@ -119,12 +129,12 @@ Source1: https://nodejs.org/dist/v%{version}/SHASUMS256.txt Source2: https://nodejs.org/dist/v%{version}/SHASUMS256.txt.sig Source3: nodejs.keyring -# Python 3.4 compatible node-gyp -### https://github.com/nodejs/node-gyp.git -### git archive v7.1.2 | xz > node-gyp_7.1.2.tar.xz -Source5: node-gyp_7.1.2.tar.xz -# Only required to run unit tests in NodeJS 10+ -Source10: update_npm_tarball.sh +# Python 3.4 compatible node-gyp +### https://github.com/nodejs/node-gyp.git +### git archive v7.1.2 | xz > node-gyp_7.1.2.tar.xz +Source5: node-gyp_7.1.2.tar.xz +# Only required to run unit tests in NodeJS 10+ +Source10: update_npm_tarball.sh Source11: node_modules.tar.xz Source20: bash_output_helper.bash @@ -135,6 +145,8 @@ Patch5: sle12_python3_compat.patch Patch7: manual_configure.patch Patch13: openssl_binary_detection.patch + + ## Patches specific to SUSE and openSUSE Patch100: linker_lto_jobs.patch # PATCH-FIX-OPENSUSE -- set correct path for dtrace if it is built @@ -161,8 +173,8 @@ Patch200: versioned.patch Patch305: qemu_timeouts_arches.patch Patch307: s390.patch -BuildRequires: fdupes BuildRequires: pkg-config +BuildRequires: fdupes BuildRequires: procps BuildRequires: xz BuildRequires: zlib-devel @@ -182,10 +194,10 @@ BuildRequires: config(netcfg) %if 0%{?suse_version} == 1110 # GCC 5 is only available in the SUSE:SLE-11:SP4:Update repository (SDK). %if %node_version_number >= 8 -BuildRequires: gcc5-c++ +BuildRequires: gcc5-c++ %define forced_gcc_version 5 %else -BuildRequires: gcc48-c++ +BuildRequires: gcc48-c++ %define forced_gcc_version 4.8 %endif %endif @@ -195,15 +207,15 @@ BuildRequires: gcc48-c++ # for SLE-12:Update targets %if 0%{?suse_version} == 1315 %if %node_version_number >= 17 -BuildRequires: gcc12-c++ +BuildRequires: gcc12-c++ %define forced_gcc_version 12 %else %if %node_version_number >= 14 -BuildRequires: gcc9-c++ +BuildRequires: gcc9-c++ %define forced_gcc_version 9 %else %if %node_version_number >= 8 -BuildRequires: gcc7-c++ +BuildRequires: gcc7-c++ %define forced_gcc_version 7 %endif %endif @@ -212,7 +224,7 @@ BuildRequires: gcc7-c++ %if 0%{?suse_version} == 1500 %if %node_version_number >= 17 -BuildRequires: gcc12-c++ +BuildRequires: gcc12-c++ %define forced_gcc_version 12 %endif %endif @@ -223,6 +235,7 @@ BuildRequires: gcc12-c++ BuildRequires: gcc-c++ %endif + # Python dependencies %if %node_version_number >= 16 @@ -248,8 +261,8 @@ BuildRequires: python %endif %if 0%{?suse_version} >= 1500 && %{node_version_number} >= 10 -BuildRequires: group(nobody) BuildRequires: user(nobody) +BuildRequires: group(nobody) %endif # shared openssl @@ -322,7 +335,7 @@ BuildRequires: valgrind %if %{with libalternatives} Requires: alts %else -Requires(postun):%{_sbindir}/update-alternatives +Requires(postun): %{_sbindir}/update-alternatives %endif # either for update-alternatives, or their removal Requires(post): %{_sbindir}/update-alternatives @@ -361,8 +374,8 @@ ExclusiveArch: not_buildable %endif %endif -Provides: bundled(libuv) = 1.44.2 Provides: bundled(uvwasi) = 0.0.13 +Provides: bundled(libuv) = 1.44.2 Provides: bundled(v8) = 10.2.154.23 %if %{with intree_brotli} Provides: bundled(brotli) = 1.0.9 @@ -370,9 +383,10 @@ Provides: bundled(brotli) = 1.0.9 BuildRequires: pkgconfig(libbrotlidec) %endif -Provides: bundled(base64) = 0.5.0 + Provides: bundled(llhttp) = 6.0.10 Provides: bundled(ngtcp2) = 0.8.1 +Provides: bundled(base64) = 0.5.0 Provides: bundled(node-acorn) = 8.8.1 @@ -392,8 +406,8 @@ provided by npm. Summary: Development headers for NodeJS 18.x Group: Development/Languages/NodeJS Provides: nodejs-devel = %{version} -Requires: %{name} = %{version} Requires: npm18 = %{version} +Requires: %{name} = %{version} %description devel This package provides development headers for Node.js needed for creation @@ -410,12 +424,12 @@ Requires: nodejs-common Requires: nodejs18 = %{version} Provides: nodejs-npm = %{version} Obsoletes: nodejs-npm < 4.0.0 -Provides: npm = %{version} Provides: npm(npm) = 8.19.3 +Provides: npm = %{version} %if 0%{?suse_version} >= 1500 %if %{node_version_number} >= 10 -Requires: group(nobody) Requires: user(nobody) +Requires: group(nobody) %endif %endif Provides: bundled(node-abbrev) = 1.1.1 @@ -581,8 +595,8 @@ Provides: bundled(node-spdx-exceptions) = 2.3.0 Provides: bundled(node-spdx-expression-parse) = 3.0.1 Provides: bundled(node-spdx-license-ids) = 3.0.11 Provides: bundled(node-ssri) = 9.0.1 -Provides: bundled(node-string-width) = 4.2.3 Provides: bundled(node-string_decoder) = 1.3.0 +Provides: bundled(node-string-width) = 4.2.3 Provides: bundled(node-strip-ansi) = 6.0.1 Provides: bundled(node-supports-color) = 7.2.0 Provides: bundled(node-tar) = 6.1.11 @@ -694,6 +708,8 @@ find -name \*~ -print0 -delete # abnormalities from patching find \( -name \*.js.orig -or -name \*.md.orig -or -name \*.1.orig \) -delete + + %build # normalize shebang %if %{node_version_number} >= 12 @@ -1048,7 +1064,6 @@ update-alternatives --remove npm-default %{_bindir}/npm%{node_version_number} update-alternatives --remove npx-default %{_bindir}/npx%{node_version_number} %else - %pre # remove files that are no longer owned but provided by update-alternatives if ! [ -L %{_mandir}/man1/node.1%{ext_man} ]; then