- 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
This commit is contained in:
Adam Majer 2023-01-26 12:59:22 +00:00 committed by Git OBS Bridge
parent d2fd477a39
commit 65a950dd73
3 changed files with 54 additions and 38 deletions

View File

@ -4,6 +4,7 @@ Wed Jan 25 12:01:18 UTC 2023 - Adam Majer <adam.majer@suse.de>
- Again use openssl-3, if available. - Again use openssl-3, if available.
- _constraints: reset aarch64 memory requirements back to original - _constraints: reset aarch64 memory requirements back to original
otherwise some unit tests can fail 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 <adam.majer@suse.de> Mon Jan 16 14:57:58 UTC 2023 - Adam Majer <adam.majer@suse.de>

View File

@ -1,7 +1,7 @@
# #
# spec file for package nodejs18 # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -15,17 +15,7 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/ # 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} %if 0%{?fedora_version}
%define ext_man .gz %define ext_man .gz
%endif %endif
@ -145,8 +135,6 @@ Patch5: sle12_python3_compat.patch
Patch7: manual_configure.patch Patch7: manual_configure.patch
Patch13: openssl_binary_detection.patch Patch13: openssl_binary_detection.patch
## Patches specific to SUSE and openSUSE ## Patches specific to SUSE and openSUSE
Patch100: linker_lto_jobs.patch Patch100: linker_lto_jobs.patch
# PATCH-FIX-OPENSUSE -- set correct path for dtrace if it is built # PATCH-FIX-OPENSUSE -- set correct path for dtrace if it is built
@ -171,9 +159,10 @@ Patch133: rsa-pss-revert.patch
Patch200: versioned.patch Patch200: versioned.patch
Patch305: qemu_timeouts_arches.patch Patch305: qemu_timeouts_arches.patch
Patch307: s390.patch
BuildRequires: pkg-config
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: pkg-config
BuildRequires: procps BuildRequires: procps
BuildRequires: xz BuildRequires: xz
BuildRequires: zlib-devel BuildRequires: zlib-devel
@ -234,7 +223,6 @@ BuildRequires: gcc12-c++
BuildRequires: gcc-c++ BuildRequires: gcc-c++
%endif %endif
# Python dependencies # Python dependencies
%if %node_version_number >= 16 %if %node_version_number >= 16
@ -260,8 +248,8 @@ BuildRequires: python
%endif %endif
%if 0%{?suse_version} >= 1500 && %{node_version_number} >= 10 %if 0%{?suse_version} >= 1500 && %{node_version_number} >= 10
BuildRequires: user(nobody)
BuildRequires: group(nobody) BuildRequires: group(nobody)
BuildRequires: user(nobody)
%endif %endif
# shared openssl # shared openssl
@ -373,8 +361,8 @@ ExclusiveArch: not_buildable
%endif %endif
%endif %endif
Provides: bundled(uvwasi) = 0.0.13
Provides: bundled(libuv) = 1.44.2 Provides: bundled(libuv) = 1.44.2
Provides: bundled(uvwasi) = 0.0.13
Provides: bundled(v8) = 10.2.154.23 Provides: bundled(v8) = 10.2.154.23
%if %{with intree_brotli} %if %{with intree_brotli}
Provides: bundled(brotli) = 1.0.9 Provides: bundled(brotli) = 1.0.9
@ -382,10 +370,9 @@ Provides: bundled(brotli) = 1.0.9
BuildRequires: pkgconfig(libbrotlidec) BuildRequires: pkgconfig(libbrotlidec)
%endif %endif
Provides: bundled(base64) = 0.5.0
Provides: bundled(llhttp) = 6.0.10 Provides: bundled(llhttp) = 6.0.10
Provides: bundled(ngtcp2) = 0.8.1 Provides: bundled(ngtcp2) = 0.8.1
Provides: bundled(base64) = 0.5.0
Provides: bundled(node-acorn) = 8.8.1 Provides: bundled(node-acorn) = 8.8.1
@ -405,8 +392,8 @@ provided by npm.
Summary: Development headers for NodeJS 18.x Summary: Development headers for NodeJS 18.x
Group: Development/Languages/NodeJS Group: Development/Languages/NodeJS
Provides: nodejs-devel = %{version} Provides: nodejs-devel = %{version}
Requires: npm18 = %{version}
Requires: %{name} = %{version} Requires: %{name} = %{version}
Requires: npm18 = %{version}
%description devel %description devel
This package provides development headers for Node.js needed for creation This package provides development headers for Node.js needed for creation
@ -423,12 +410,12 @@ Requires: nodejs-common
Requires: nodejs18 = %{version} Requires: nodejs18 = %{version}
Provides: nodejs-npm = %{version} Provides: nodejs-npm = %{version}
Obsoletes: nodejs-npm < 4.0.0 Obsoletes: nodejs-npm < 4.0.0
Provides: npm(npm) = 8.19.3
Provides: npm = %{version} Provides: npm = %{version}
Provides: npm(npm) = 8.19.3
%if 0%{?suse_version} >= 1500 %if 0%{?suse_version} >= 1500
%if %{node_version_number} >= 10 %if %{node_version_number} >= 10
Requires: user(nobody)
Requires: group(nobody) Requires: group(nobody)
Requires: user(nobody)
%endif %endif
%endif %endif
Provides: bundled(node-abbrev) = 1.1.1 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-expression-parse) = 3.0.1
Provides: bundled(node-spdx-license-ids) = 3.0.11 Provides: bundled(node-spdx-license-ids) = 3.0.11
Provides: bundled(node-ssri) = 9.0.1 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-width) = 4.2.3
Provides: bundled(node-string_decoder) = 1.3.0
Provides: bundled(node-strip-ansi) = 6.0.1 Provides: bundled(node-strip-ansi) = 6.0.1
Provides: bundled(node-supports-color) = 7.2.0 Provides: bundled(node-supports-color) = 7.2.0
Provides: bundled(node-tar) = 6.1.11 Provides: bundled(node-tar) = 6.1.11
@ -693,6 +680,7 @@ popd
%patch200 -p1 %patch200 -p1
%patch305 -p1 %patch305 -p1
%patch307 -p1
%if %{node_version_number} <= 12 %if %{node_version_number} <= 12
# minimist security update - patch50 # minimist security update - patch50
@ -706,8 +694,6 @@ find -name \*~ -print0 -delete
# abnormalities from patching # abnormalities from patching
find \( -name \*.js.orig -or -name \*.md.orig -or -name \*.1.orig \) -delete find \( -name \*.js.orig -or -name \*.md.orig -or -name \*.1.orig \) -delete
%build %build
# normalize shebang # normalize shebang
%if %{node_version_number} >= 12 %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} update-alternatives --remove npx-default %{_bindir}/npx%{node_version_number}
%else %else
%pre %pre
# remove files that are no longer owned but provided by update-alternatives # remove files that are no longer owned but provided by update-alternatives
if ! [ -L %{_mandir}/man1/node.1%{ext_man} ]; then if ! [ -L %{_mandir}/man1/node.1%{ext_man} ]; then

28
s390.patch Normal file
View File

@ -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(),
]);