2
0
forked from pool/nodejs21

- Package new version 21.1.0

For overview of changes and details since 20.x and earlier see
  https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V21.md#21.0.0
- imported the following patches from prior patches:
  + cares_public_headers.patch
  + fix_ci_tests.patch
  + flaky_test_rerun.patch
  + gcc13.patch
  + legacy_python.patch
  + linker_lto_jobs.patch
  + manual_configure.patch
  + node-gyp-addon-gypi.patch
  + node-gyp-config.patch
  + nodejs20-zlib-1.3.patch
  + nodejs-libpath.patch
  + npm_search_paths.patch
  + openssl_binary_detection.patch
  + qemu_timeouts_arches.patch
  + skip_no_console.patch
  + sle12_python3_compat.patch
  + test-skip-y2038-on-32bit-time_t.patch
  + versioned.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs21?expand=0&rev=1
This commit is contained in:
Adam Majer 2023-11-07 09:48:41 +00:00 committed by Git OBS Bridge
commit b9ebe15f35
30 changed files with 2093 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

41
SHASUMS256.txt Normal file
View File

@ -0,0 +1,41 @@
691672195af440401e4957d9d5e148d361e686aa26c9e529505edf89bab4b089 node-v21.1.0-aix-ppc64.tar.gz
75f28378c09fba7c5ecd6add07ac64f4983f23a847987e0a2097d753b0dcb30c node-v21.1.0-arm64.msi
4872463830381785b91d13a7fbb9b6f4a9c7658e10d964f6c421951cec8833ad node-v21.1.0-darwin-arm64.tar.gz
ecd3f51874892a8a56abf4b96424236647f26f64da6139a930557c044c48f73b node-v21.1.0-darwin-arm64.tar.xz
6b526c08320fcf41ced0ceee7588828ea2cb07ba826af4ff82b0ec53958fd8a4 node-v21.1.0-darwin-x64.tar.gz
f33382175ab49d0c9bd176401e746a041db1c7c31c85b7b91344e188945c3ba1 node-v21.1.0-darwin-x64.tar.xz
ceb2ecd7ed6049778403c0baa49844ba9495c1218b55bb73dea42a87e6a57253 node-v21.1.0-headers.tar.gz
c1ab3d18209f1331b9f14cdea0aeb2f7fdce4583aceee001856a42e44cfe1b35 node-v21.1.0-headers.tar.xz
5480f438703049f55f19fc3247f6aa1e8059b2f47cf08e9adfdcb7ce7aedff70 node-v21.1.0-linux-arm64.tar.gz
ff487ad68d898a6eebbf02e15fe5c5a885991828732163501fdf21af7a7bef36 node-v21.1.0-linux-arm64.tar.xz
0d51fe055599c17b2e3389d15868d4fd5ca07b408f8c15c325874595310a9382 node-v21.1.0-linux-armv7l.tar.gz
a8de516f50e6f4a7325d115a7cf398ac15440d495672f5d0118296b5d593fee9 node-v21.1.0-linux-armv7l.tar.xz
ed90f74545cd44474bbb947544679d3dfb44403200f7d2faa49402bebf26e52f node-v21.1.0-linux-ppc64le.tar.gz
8c932a1259291e8db9874981886d17993ab82ecf1ecaeda2c102b5f44ef94593 node-v21.1.0-linux-ppc64le.tar.xz
b45b87d21dada54999ef8d80957a6e700d0d29dd1b7f23502223c4a67d9d0a10 node-v21.1.0-linux-s390x.tar.gz
a8d04ae7a2b401e469a2c7e1e579d985126d3ec1a024bcc5220a059fcf861c17 node-v21.1.0-linux-s390x.tar.xz
b919cad4e8a5abbd7e6a4433c4f8a7cdc1a78c1e526c6c1aa4a5fcf74011ad2b node-v21.1.0-linux-x64.tar.gz
6a1020b5605ba4b4a89b08147e5fd124bd9d1fd5bfe5301fe0567af67bf0e335 node-v21.1.0-linux-x64.tar.xz
5fcb23725fa760ebe059cc5d957e9214f22ba623b20ee20301089a89d33bc06f node-v21.1.0.pkg
86e2fbfa8a9977656a82bb1a15208e7d45bd7a05dec331d0abf6fcf938a97cc3 node-v21.1.0.tar.gz
91ac72e4444c5e5ab4b448030a61ffa95acd35d34a9d31d2d220ee2bed01b925 node-v21.1.0.tar.xz
8a0f2c3abea32eb1706772d741ed8ea05de8f0b170561b37088cb2412de5cb2b node-v21.1.0-win-arm64.7z
fe660ef5ff0a1cf09207a1d83dbac5cfa0495870717aa397b584ce0c3e5cfcfb node-v21.1.0-win-arm64.zip
20ad766d8576e0c651dcbd6cbafaf803a51110613304224820c38936858af774 node-v21.1.0-win-x64.7z
6ee3e74ecceb27f388d75a94d6782df670bad37a4d10ff2d28a7c7bcb75bdb49 node-v21.1.0-win-x64.zip
3247272d574287ea798a34bd5a393671d44d0f608434f06eb97696754ee0257f node-v21.1.0-win-x86.7z
d4c3834a00cf0d74ca80d5e9992acb98f7d703293a18eb1716d596148ff855a8 node-v21.1.0-win-x86.zip
9890aaf7b9387a6d15890735b8facfe9eb072aebfd30e38cbeaf3426a1eabdc0 node-v21.1.0-x64.msi
53f8248e82282552f9fe5709a771801c4adb174f6dc35e2610077edc758d2bcf node-v21.1.0-x86.msi
69d61ca95c2a81f2a8f535446a2bfdd8b905d1b1783d18ae82b92017a637ab61 win-arm64/node.exe
aa149ab68ccab472beea201d39283390547c8e0a12b099797a0cfb6d9ffefb7b win-arm64/node.lib
085701532872fa03f7c29148b6b880245a765ee5f2c51593fc97a848730f9a57 win-arm64/node_pdb.7z
97580ce603887840a19f314a7eeaede4e18b72de0dfda060ea5ac4e747fc6465 win-arm64/node_pdb.zip
1cbbd083f79c51c6ca4d3ccffc944895d4e04e182849fd49855d93b66c0bb411 win-x64/node.exe
2f88106acb54a105e7beda077ab9eda04d98c202db9c1477ea48d7dd9e58151a win-x64/node.lib
f100227a3a7351c7340ef440a6b7dc2a4c2ab9786d0d3f8f603fb5658c423946 win-x64/node_pdb.7z
7b29f3242e0eaffb8990d8cd375a6a9d48079708e3dbc676c7a30d67895e052f win-x64/node_pdb.zip
2374196fac3d6b3611a411a6c413f1a78f47e47f7d5a86e861e774bf8203bc10 win-x86/node.exe
6825637ae988424a72f049ba92264be2956881875ee264cb71441bfbff5bcd85 win-x86/node.lib
842afb550c8821b82a1136dc29a3d0a0c862a045bea2c9940148569305a867c3 win-x86/node_pdb.7z
3e5357d128e79924866b1ed039458f43af377676c2d3b0fbba751986be14a833 win-x86/node_pdb.zip

BIN
SHASUMS256.txt.sig Normal file

Binary file not shown.

32
_constraints Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0"?>
<constraints>
<hardware>
<disk>
<size unit="G">8</size>
</disk>
<physicalmemory>
<size unit="M">10000</size>
</physicalmemory>
</hardware>
<overwrite>
<conditions>
<arch>aarch64</arch>
</conditions>
<hardware>
<cpu>
<flag>asimdrdm</flag>
</cpu>
</hardware>
</overwrite>
<overwrite>
<conditions>
<arch>armv6l</arch>
<arch>armv7l</arch>
</conditions>
<hardware>
<physicalmemory>
<size unit="G">5</size>
</physicalmemory>
</hardware>
</overwrite>
</constraints>

16
bash_output_helper.bash Normal file
View File

@ -0,0 +1,16 @@
#
# Node can break stdin/stdout/stderr by setting them O_NONBLOCK
# and then not resetting it back to blocking mode on exit
# This function redirects stdio descriptors via new logging pipe
#
function decoupled_cmd
{
mkfifo _log
($@) < /dev/null > _log 2>_log &
cat _log
rm _log
wait $!
}

View File

@ -0,0 +1,13 @@
Index: node-v14.17.5/src/cares_wrap.h
===================================================================
--- node-v14.17.5.orig/src/cares_wrap.h
+++ node-v14.17.5/src/cares_wrap.h
@@ -22,7 +22,7 @@
# include <netdb.h>
#endif // __POSIX__
-# include <ares_nameser.h>
+#include <arpa/nameser.h>
namespace node {
namespace cares_wrap {

98
fix_ci_tests.patch Normal file
View File

@ -0,0 +1,98 @@
Author: Adam Majer <amajer@suse.de>
Date: Dec 20 09:18:49 UTC 2017
Summary: Fix CI unit tests framework for OBS building
Index: node-v20.8.1/test/parallel/test-module-loading-globalpaths.js
===================================================================
--- node-v20.8.1.orig/test/parallel/test-module-loading-globalpaths.js
+++ node-v20.8.1/test/parallel/test-module-loading-globalpaths.js
@@ -11,6 +11,9 @@ const { addLibraryPath } = require('../c
addLibraryPath(process.env);
+common.skip('hardcoded global paths');
+return;
+
if (process.argv[2] === 'child') {
console.log(require(pkgName).string);
} else {
Index: node-v20.8.1/test/parallel/test-tls-passphrase.js
===================================================================
--- node-v20.8.1.orig/test/parallel/test-tls-passphrase.js
+++ node-v20.8.1/test/parallel/test-tls-passphrase.js
@@ -223,7 +223,7 @@ server.listen(0, common.mustCall(functio
}, onSecureConnect());
})).unref();
-const errMessageDecrypt = /bad decrypt/;
+const errMessageDecrypt = /bad (decrypt|password read)/;
// Missing passphrase
assert.throws(function() {
Index: node-v20.8.1/test/parallel/test-repl-envvars.js
===================================================================
--- node-v20.8.1.orig/test/parallel/test-repl-envvars.js
+++ node-v20.8.1/test/parallel/test-repl-envvars.js
@@ -2,7 +2,9 @@
// Flags: --expose-internals
-require('../common');
+const common = require('../common');
+common.skip('Not running test in OBS');
+
const stream = require('stream');
const { describe, test } = require('node:test');
const REPL = require('internal/repl');
Index: node-v20.8.1/Makefile
===================================================================
--- node-v20.8.1.orig/Makefile
+++ node-v20.8.1/Makefile
@@ -545,7 +545,8 @@ test-ci-js: | clear-stalled
.PHONY: test-ci
# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned
test-ci: LOGLEVEL := info
-test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests doc-only
+test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests
+ strip $(NODE_EXE)
out/Release/cctest --gtest_output=xml:out/junit/cctest.xml
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \
@@ -726,7 +727,8 @@ apidocs_json = $(addprefix out/,$(apidoc
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
tools/doc/node_modules: tools/doc/package.json
- @if [ "$(shell $(node_use_openssl))" != "true" ]; then \
+ echo "Skipping tools/doc/node_modules"
+# @if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping tools/doc/node_modules (no crypto)"; \
else \
cd tools/doc && $(call available-node,$(run-npm-ci)) \
Index: node-v20.8.1/tools/test.py
===================================================================
--- node-v20.8.1.orig/tools/test.py
+++ node-v20.8.1/tools/test.py
@@ -1361,7 +1361,7 @@ def BuildOptions():
result.add_option("-s", "--suite", help="A test suite",
default=[], action="append")
result.add_option("-t", "--timeout", help="Timeout in seconds",
- default=120, type="int")
+ default=1200, type="int")
result.add_option("--arch", help='The architecture to run tests for',
default='none')
result.add_option("--snapshot", help="Run the tests with snapshot turned on",
Index: node-v20.8.1/test/parallel/test-crypto-dh.js
===================================================================
--- node-v20.8.1.orig/test/parallel/test-crypto-dh.js
+++ node-v20.8.1/test/parallel/test-crypto-dh.js
@@ -87,9 +87,7 @@ const crypto = require('crypto');
assert.throws(() => {
dh3.computeSecret('');
- }, { message: common.hasOpenSSL3 ?
- 'error:02800080:Diffie-Hellman routines::invalid secret' :
- 'Supplied key is too small' });
+ }, /(error:02800080:Diffie-Hellman routines::invalid secret|error:05066066:Diffie-Hellman routines:compute_key:invalid public key|Supplied key is too small)/);
}
// Through a fluke of history, g=0 defaults to DH_GENERATOR (2).

21
flaky_test_rerun.patch Normal file
View File

@ -0,0 +1,21 @@
Index: node-v16.13.0/tools/test.py
===================================================================
--- node-v16.13.0.orig/tools/test.py
+++ node-v16.13.0/tools/test.py
@@ -586,6 +586,16 @@ class TestCase(object):
self.context.store_unexpected_output)
def Run(self):
+ reruns = 0
+ while (reruns < 5):
+ reruns += 1
+ result = self.OriginalRun()
+ if (not result.HasFailed()):
+ break
+ print("FLAKY TEST rerun: ", self.GetCommand())
+ return result
+
+ def OriginalRun(self):
try:
result = self.RunCommand(self.GetCommand(), {
"TEST_SERIAL_ID": "%d" % self.serial_id,

36
gcc13.patch Normal file
View File

@ -0,0 +1,36 @@
Index: node-v20.0.0/deps/v8/src/builtins/builtins-array-gen.cc
===================================================================
--- node-v20.0.0.orig/deps/v8/src/builtins/builtins-array-gen.cc
+++ node-v20.0.0/deps/v8/src/builtins/builtins-array-gen.cc
@@ -18,6 +18,7 @@
#include "src/objects/arguments-inl.h"
#include "src/objects/elements-kind.h"
#include "src/objects/property-cell.h"
+#include "src/wasm/wasm-objects.h"
namespace v8 {
namespace internal {
Index: node-v20.0.0/deps/v8/src/builtins/builtins-array.cc
===================================================================
--- node-v20.0.0.orig/deps/v8/src/builtins/builtins-array.cc
+++ node-v20.0.0/deps/v8/src/builtins/builtins-array.cc
@@ -22,6 +22,7 @@
#include "src/objects/objects-inl.h"
#include "src/objects/prototype.h"
#include "src/objects/smi.h"
+#include "src/wasm/wasm-objects.h"
namespace v8 {
namespace internal {
Index: node-v20.0.0/deps/v8/src/codegen/tnode.h
===================================================================
--- node-v20.0.0.orig/deps/v8/src/codegen/tnode.h
+++ node-v20.0.0/deps/v8/src/codegen/tnode.h
@@ -6,6 +6,7 @@
#define V8_CODEGEN_TNODE_H_
#include "src/codegen/machine-type.h"
+#include "src/wasm/wasm-objects.h"
namespace v8 {
namespace internal {

26
legacy_python.patch Normal file
View File

@ -0,0 +1,26 @@
Index: node-v18.11.0/tools/utils.py
===================================================================
--- node-v18.11.0.orig/tools/utils.py
+++ node-v18.11.0/tools/utils.py
@@ -26,10 +26,10 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import glob
import platform
import re
import sys
+from pathlib import Path
# Reads a .list file into an array of strings
@@ -109,7 +109,8 @@ def IsWindows():
def SearchFiles(dir, ext):
- list = glob.glob(dir+ '/**/*.' + ext, recursive=True)
+ list = Path(dir).glob('**/*.' + ext)
+ list = [ str(x) for x in list ]
if sys.platform == 'win32':
list = [ x.replace('\\', '/')for x in list]
return sorted(list)

25
linker_lto_jobs.patch Normal file
View File

@ -0,0 +1,25 @@
Purpose of these dependencies is to make sure that the linker
is run serially over these binaries instead of in parallel.
OBS workers run out of memory as each executable seems to require
upward of 5G RAM
Index: node-v19.7.0/node.gyp
===================================================================
--- node-v19.7.0.orig/node.gyp
+++ node-v19.7.0/node.gyp
@@ -951,6 +951,7 @@
'deps/uvwasi/uvwasi.gyp:uvwasi',
'deps/simdutf/simdutf.gyp:simdutf',
'deps/ada/ada.gyp:ada',
+ 'fuzz_env'
],
'includes': [
@@ -1047,6 +1048,7 @@
'deps/histogram/histogram.gyp:histogram',
'deps/uvwasi/uvwasi.gyp:uvwasi',
'deps/ada/ada.gyp:ada',
+ 'cctest'
],
'includes': [

20
manual_configure.patch Normal file
View File

@ -0,0 +1,20 @@
Author: Adam Majer <amajer@suse.de>
Date: Wed May 23 14:13:33 CEST 2018
Summary: This config.h is defined by hand
Gyp doesn't run autotools, so this config is not quite correct.
Update to prevent implicit defines to be used.
Index: node-git.8dae89b396/deps/nghttp2/lib/includes/config.h
===================================================================
--- node-git.8dae89b396.orig/deps/nghttp2/lib/includes/config.h
+++ node-git.8dae89b396/deps/nghttp2/lib/includes/config.h
@@ -71,7 +71,7 @@ typedef intptr_t ssize_t;
/* #undef HAVE_NETDB_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
-/* #undef HAVE_NETINET_IN_H */
+#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */

79
node-gyp-addon-gypi.patch Normal file
View File

@ -0,0 +1,79 @@
Index: node-git.b4f0a18b5a/addon-rpm.gypi
===================================================================
--- /dev/null
+++ node-git.b4f0a18b5a/addon-rpm.gypi
@@ -0,0 +1,35 @@
+{
+ 'target_defaults': {
+ 'type': 'loadable_module',
+ 'product_prefix': '',
+ 'include_dirs': [
+ '/usr/include/node21/',
+ '/usr/include/'
+ ],
+
+ 'target_conditions': [
+ ['_type=="loadable_module"', {
+ 'product_extension': 'node',
+ 'defines': [ 'BUILDING_NODE_EXTENSION' ],
+ }]
+ ],
+
+ 'conditions': [
+ [ 'OS=="mac"', {
+ 'libraries': [ '-undefined dynamic_lookup' ],
+ 'xcode_settings': {
+ 'DYLIB_INSTALL_NAME_BASE': '@rpath'
+ },
+ }],
+ [ 'OS=="win"', {
+ 'libraries': [ '-l<(node_root_dir)/$(Configuration)/node.lib' ],
+ # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
+ # needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
+ 'msvs_disabled_warnings': [ 4251 ],
+ }],
+ [ 'OS=="freebsd" or OS=="openbsd" or OS=="solaris" or (OS=="linux" and target_arch!="ia32")', {
+ 'cflags': [ '-fPIC' ],
+ }]
+ ]
+ }
+}
Index: node-git.b4f0a18b5a/deps/npm/node_modules/node-gyp/lib/configure.js
===================================================================
--- node-git.b4f0a18b5a.orig/deps/npm/node_modules/node-gyp/lib/configure.js
+++ node-git.b4f0a18b5a/deps/npm/node_modules/node-gyp/lib/configure.js
@@ -46,10 +46,6 @@ function configure (gyp, argv, callback)
if ('v' + release.version !== process.version) {
// if --target was given, then determine a target version to compile for
log.verbose('get node dir', 'compiling against --target node version: %s', release.version)
- } else {
- // if no --target was specified then use the current host node version
- log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version)
- }
if (!release.semver) {
// could not parse the version string with semver
@@ -68,6 +64,12 @@ function configure (gyp, argv, callback)
nodeDir = path.resolve(gyp.devDir, release.versionDir)
createBuildDir()
})
+ } else {
+ // if no --target was specified then use RPM-installed headers
+ log.verbose('get node dir', 'no --target version specified, falling back to RPM installed headers')
+ nodeDir = '/usr/include/node21'
+ createBuildDir()
+ }
}
}
@@ -282,7 +284,9 @@ function configure (gyp, argv, callback)
// this logic ported from the old `gyp_addon` python file
var gypScript = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py')
- var addonGypi = path.resolve(__dirname, '..', 'addon.gypi')
+ var addon_gypi_file = gyp.opts.target || gyp.opts.nodedir ? 'addon.gypi' : 'addon-rpm.gypi'
+
+ var addonGypi = path.resolve(__dirname, '..', addon_gypi_file)
var commonGypi = path.resolve(nodeDir, 'include/node/common.gypi')
fs.stat(commonGypi, function (err) {
if (err) {

13
node-gyp-config.patch Normal file
View File

@ -0,0 +1,13 @@
Index: node-v19.1.0/deps/npm/node_modules/node-gyp/lib/configure.js
===================================================================
--- node-v19.1.0.orig/deps/npm/node_modules/node-gyp/lib/configure.js
+++ node-v19.1.0/deps/npm/node_modules/node-gyp/lib/configure.js
@@ -96,7 +96,7 @@ function configure (gyp, argv, callback)
log.verbose('build/' + configFilename, 'creating config file')
- var config = process.config || {}
+ var config = JSON.parse(JSON.stringify(process.config || {}))
var defaults = config.target_defaults
var variables = config.variables

3
node-v21.1.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:91ac72e4444c5e5ab4b448030a61ffa95acd35d34a9d31d2d220ee2bed01b925
size 42651096

3
node_modules.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6670ae8adbdd5a7459611aab7e42d11fd4250d437ac9dfe28f7c346913728dc3
size 1303192

54
nodejs-libpath.patch Normal file
View File

@ -0,0 +1,54 @@
Index: node-v18.9.0/tools/install.py
===================================================================
--- node-v18.9.0.orig/tools/install.py
+++ node-v18.9.0/tools/install.py
@@ -7,6 +7,7 @@ import errno
import os
import shutil
import sys
+from distutils import sysconfig
import re
# set at init time
@@ -66,6 +67,10 @@ def try_copy(path, dst):
try_unlink(target_path) # prevent ETXTBSY errors
return shutil.copy2(source_path, target_path)
+def libdir():
+ libdir_fq = sysconfig.get_config_var("LIBDIR")
+ return re.sub("^" + re.escape(node_prefix + "/"), "", libdir_fq)
+
def try_remove(path, dst):
source_path, target_path = mkpaths(path, dst)
print('removing %s' % target_path)
@@ -81,7 +86,7 @@ def uninstall(paths, dst):
try_remove(path, dst)
def package_files(action, name, bins):
- target_path = 'lib/node_modules/' + name + '/'
+ target_path = libdir() + '/node_modules/' + name + '/'
# don't install npm if the target path is a symlink, it probably means
# that a dev version of npm is installed there
@@ -101,7 +106,7 @@ def package_files(action, name, bins):
if action == uninstall:
action([link_path], 'bin/' + bin_name)
elif action == install:
- try_symlink('../lib/node_modules/' + name + '/' + bin_target, link_path)
+ try_symlink('../' + libdir() + '/node_modules/' + name + '/' + bin_target, link_path)
else:
assert 0 # unhandled action type
Index: node-v18.9.0/lib/internal/modules/cjs/loader.js
===================================================================
--- node-v18.9.0.orig/lib/internal/modules/cjs/loader.js
+++ node-v18.9.0/lib/internal/modules/cjs/loader.js
@@ -1254,7 +1254,7 @@ Module._initPaths = function() {
path.resolve(process.execPath, '..') :
path.resolve(process.execPath, '..', '..');
- const paths = [path.resolve(prefixDir, 'lib', 'node')];
+ const paths = ['/usr/lib/node'];
if (homeDir) {
ArrayPrototypeUnshift(paths, path.resolve(homeDir, '.node_libraries'));

BIN
nodejs.keyring Normal file

Binary file not shown.

13
nodejs20-zlib-1.3.patch Normal file
View File

@ -0,0 +1,13 @@
Index: node-v20.8.1/test/parallel/test-process-versions.js
===================================================================
--- node-v20.8.1.orig/test/parallel/test-process-versions.js
+++ node-v20.8.1/test/parallel/test-process-versions.js
@@ -61,7 +61,7 @@ assert.match(process.versions.brotli, co
assert.match(process.versions.llhttp, commonTemplate);
assert.match(process.versions.node, commonTemplate);
assert.match(process.versions.uv, commonTemplate);
-assert.match(process.versions.zlib, /^\d+(?:\.\d+){2,3}(?:-.*)?$/);
+assert.match(process.versions.zlib, /^\d+(?:\.\d+){1,3}(?:-.*)?$/);
if (hasUndici) {
assert.match(process.versions.undici, commonTemplate);

27
nodejs21.changes Normal file
View File

@ -0,0 +1,27 @@
-------------------------------------------------------------------
Tue Nov 7 09:18:37 UTC 2023 - Adam Majer <adam.majer@suse.de>
- Package new version 21.1.0
For overview of changes and details since 20.x and earlier see
https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V21.md#21.0.0
- imported the following patches from prior patches:
+ cares_public_headers.patch
+ fix_ci_tests.patch
+ flaky_test_rerun.patch
+ gcc13.patch
+ legacy_python.patch
+ linker_lto_jobs.patch
+ manual_configure.patch
+ node-gyp-addon-gypi.patch
+ node-gyp-config.patch
+ nodejs20-zlib-1.3.patch
+ nodejs-libpath.patch
+ npm_search_paths.patch
+ openssl_binary_detection.patch
+ qemu_timeouts_arches.patch
+ skip_no_console.patch
+ sle12_python3_compat.patch
+ test-skip-y2038-on-32bit-time_t.patch
+ versioned.patch

1151
nodejs21.spec Normal file

File diff suppressed because it is too large Load Diff

32
npm_search_paths.patch Normal file
View File

@ -0,0 +1,32 @@
Index: node-v19.9.0/deps/npm/lib/commands/help-search.js
===================================================================
--- node-v19.9.0.orig/deps/npm/lib/commands/help-search.js
+++ node-v19.9.0/deps/npm/lib/commands/help-search.js
@@ -16,7 +16,7 @@ class HelpSearch extends BaseCommand {
throw this.usageError()
}
- const docPath = path.resolve(this.npm.npmRoot, 'docs/content')
+ const docPath = '/usr/share/doc/packages/nodejs'
let files = await glob(`${globify(docPath)}/*/*.md`)
// preserve glob@8 behavior
files = files.sort((a, b) => a.localeCompare(b, 'en'))
Index: node-v19.9.0/deps/npm/lib/npm.js
===================================================================
--- node-v19.9.0.orig/deps/npm/lib/npm.js
+++ node-v19.9.0/deps/npm/lib/npm.js
@@ -408,7 +408,13 @@ class Npm extends EventEmitter {
}
get globalPrefix () {
- return this.config.globalPrefix
+ let prefix = this.config.globalPrefix
+
+ // don't poop all over distro territory - use /usr/local instead
+ if (prefix === '/usr')
+ return '/usr/local'
+
+ return prefix;
}
set globalPrefix (r) {

View File

@ -0,0 +1,42 @@
Allow non-standard openssl binary names
Index: node-v14.15.1/test/common/index.js
===================================================================
--- node-v14.15.1.orig/test/common/index.js
+++ node-v14.15.1/test/common/index.js
@@ -797,20 +797,28 @@ const common = {
get opensslCli() {
if (opensslCli !== null) return opensslCli;
+ let cli_candidates = [];
+
if (process.config.variables.node_shared_openssl) {
// Use external command
- opensslCli = 'openssl';
+ cli_candidates = cli_candidates.concat(['openssl-1_1', 'openssl']);
} else {
// Use command built from sources included in Node.js repository
- opensslCli = path.join(path.dirname(process.execPath), 'openssl-cli');
+ cli_candidates.push(path.join(path.dirname(process.execPath), 'openssl-cli'));
}
- if (exports.isWindows) opensslCli += '.exe';
+ let checkOpensslCli = function(opensslCli) {
+ if (exports.isWindows) opensslCli += '.exe';
+ const opensslCmd = spawnSync(opensslCli, ['version']);
+ if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) {
+ // OpenSSL command cannot be executed
+ opensslCli = false;
+ }
+ return opensslCli;
+ };
- const opensslCmd = spawnSync(opensslCli, ['version']);
- if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) {
- // OpenSSL command cannot be executed
- opensslCli = false;
+ for (let i=0; i<cli_candidates.length && !opensslCli; i=i+1) {
+ opensslCli = checkOpensslCli(cli_candidates[i]);
}
return opensslCli;
},

View File

@ -0,0 +1,14 @@
Index: node-v18.10.0/test/common/index.js
===================================================================
--- node-v18.10.0.orig/test/common/index.js
+++ node-v18.10.0/test/common/index.js
@@ -260,6 +260,9 @@ function platformTimeout(ms) {
if (isPi)
return multipliers.two * ms; // Raspberry Pi devices
+ if (process.arch === 'riscv64') // usermode qemu slow
+ return multipliers.seven * ms;
+
return ms;
}

29
skip_no_console.patch Normal file
View File

@ -0,0 +1,29 @@
Index: node-v14.3.0/test/parallel/test-repl-mode.js
===================================================================
--- node-v14.3.0.orig/test/parallel/test-repl-mode.js
+++ node-v14.3.0/test/parallel/test-repl-mode.js
@@ -1,9 +1,11 @@
'use strict';
-require('../common');
+const common = require('../common');
const assert = require('assert');
const Stream = require('stream');
const repl = require('repl');
+common.skipIfDumbTerminal();
+
const tests = [
testSloppyMode,
testStrictMode,
Index: node-v14.3.0/test/parallel/test-repl-strict-mode-previews.js
===================================================================
--- node-v14.3.0.orig/test/parallel/test-repl-strict-mode-previews.js
+++ node-v14.3.0/test/parallel/test-repl-strict-mode-previews.js
@@ -5,6 +5,7 @@
const common = require('../common');
common.skipIfInspectorDisabled();
+common.skipIfDumbTerminal();
if (process.argv[2] === 'child') {
const stream = require('stream');

View File

@ -0,0 +1,35 @@
Index: node-v19.1.0/configure
===================================================================
--- node-v19.1.0.orig/configure
+++ node-v19.1.0/configure
@@ -23,7 +23,7 @@ except ImportError:
from distutils.spawn import find_executable as which
print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
-acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
+acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6), (3, 4))
if sys.version_info[:2] in acceptable_pythons:
import configure
else:
Index: node-v19.1.0/deps/npm/node_modules/node-gyp/lib/find-python.js
===================================================================
--- node-v19.1.0.orig/deps/npm/node_modules/node-gyp/lib/find-python.js
+++ node-v19.1.0/deps/npm/node_modules/node-gyp/lib/find-python.js
@@ -15,7 +15,7 @@ const programFiles = process.env.Program
const programFilesX86 = process.env['ProgramFiles(x86)'] || `${programFiles} (x86)`
const winDefaultLocationsArray = []
-for (const majorMinor of ['39', '38', '37', '36']) {
+for (const majorMinor of ['39', '38', '37', '36', '34']) {
if (foundLocalAppData) {
winDefaultLocationsArray.push(
`${localAppData}\\Programs\\Python\\Python${majorMinor}\\python.exe`,
@@ -49,7 +49,7 @@ PythonFinder.prototype = {
log: logWithPrefix(log, 'find Python'),
argsExecutable: ['-c', 'import sys; print(sys.executable);'],
argsVersion: ['-c', 'import sys; print("%s.%s.%s" % sys.version_info[:3]);'],
- semverRange: '>=3.6.0',
+ semverRange: '>=3.4.0',
// These can be overridden for testing:
execFile: cp.execFile,

View File

@ -0,0 +1,45 @@
Skip 'test/parallel/test-fs-utimes-y2K38.js' on some platforms.
This test fails if coreutils' touch was built with 64-bit time_t,
while nodejs was built with 32-bit time_t. This is currently the case
on i586, ppc and arm. Skip the failing last command on those
platforms.
The failure was seen since coreutils-9.0.
Remove this patch once nodejs(1) also builds with 64-bit time_t.
---
test/parallel/test-fs-utimes-y2K38.js | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Index: node-v16.6.2/test/parallel/test-fs-utimes-y2K38.js
===================================================================
--- node-v16.6.2.orig/test/parallel/test-fs-utimes-y2K38.js
+++ node-v16.6.2/test/parallel/test-fs-utimes-y2K38.js
@@ -20,6 +20,26 @@ if (!common.isWindows) {
common.skip('File system appears to lack Y2K38 support (touch failed)');
}
+ // SUSE: touch-9.0 may succeed on platforms with 32-bit time_t,
+ // but the test would fail. Skip on those platforms for now.
+ const unameResult = spawnSync('uname',
+ ['-m'],
+ { encoding: 'utf8' });
+ if (unameResult.status === 0) {
+ if (unameResult.stdout.trim() === 'i686') {
+ common.skip('SUSE: test skipped on platforms with 32-bit time_t');
+ }
+ if (unameResult.stdout.trim() === 'ppc') {
+ common.skip('SUSE: test skipped on platforms with 32-bit time_t');
+ }
+ if (unameResult.stdout.trim() === 'armv6l') {
+ common.skip('SUSE: test skipped on platforms with 32-bit time_t');
+ }
+ if (unameResult.stdout.trim() === 'armv7l') {
+ common.skip('SUSE: test skipped on platforms with 32-bit time_t');
+ }
+ }
+
// On some file systems that lack Y2K38 support, `touch` will succeed but
// the time will be incorrect.
const dateResult = spawnSync('date',

13
update_npm_tarball.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/bash
#
# Fetch npm module tarball that is required to run unit tests
# which are not provided by upstream tarball
#
set -e
tar Jxf node-v*.tar.xz
cd node-v*/tools/doc
npm ci
cd ../..
exec tar Jcf ../node_modules.tar.xz tools/doc/node_modules

188
versioned.patch Normal file
View File

@ -0,0 +1,188 @@
Author: Adam Majer <amajer@suse.de>
Date: Fri May 11 16:10:16 CEST 2018
Summary: Generate versioned binaries
Generate versioned binaries and install paths
so we can allow concurrent installations and
management via update_alternatives.
This is also important for generation of binary
modules for multiple versions of NodeJS
Index: node-v20.5.1/Makefile
===================================================================
--- node-v20.5.1.orig/Makefile
+++ node-v20.5.1/Makefile
@@ -76,7 +76,7 @@ BUILDTYPE_LOWER := $(shell echo $(BUILDT
EXEEXT := $(shell $(PYTHON) -c \
"import sys; print('.exe' if sys.platform == 'win32' else '')")
-NODE_EXE = node$(EXEEXT)
+NODE_EXE = node21$(EXEEXT)
NODE ?= ./$(NODE_EXE)
NODE_G_EXE = node_g$(EXEEXT)
NPM ?= ./deps/npm/bin/npm-cli.js
Index: node-v20.5.1/tools/install.py
===================================================================
--- node-v20.5.1.orig/tools/install.py
+++ node-v20.5.1/tools/install.py
@@ -86,7 +86,7 @@ def uninstall(paths, dst):
try_remove(path, dst)
def package_files(action, name, bins):
- target_path = libdir() + '/node_modules/' + name + '/'
+ target_path = libdir() + '/node_modules/' + name + '21/'
# don't install npm if the target path is a symlink, it probably means
# that a dev version of npm is installed there
@@ -106,19 +106,19 @@ def package_files(action, name, bins):
if action == uninstall:
action([link_path], 'bin/' + bin_name)
elif action == install:
- try_symlink('../' + libdir() + '/node_modules/' + name + '/' + bin_target, link_path)
+ try_symlink('../' + libdir() + '/node_modules/' + name + '21/' + bin_target, link_path)
else:
assert 0 # unhandled action type
def npm_files(action):
package_files(action, 'npm', {
- 'npm': 'bin/npm-cli.js',
- 'npx': 'bin/npx-cli.js',
+ 'npm21': 'bin/npm-cli.js',
+ 'npx21': 'bin/npx-cli.js',
})
def corepack_files(action):
package_files(action, 'corepack', {
- 'corepack': 'dist/corepack.js',
+ 'corepack21': 'dist/corepack.js',
# Not the default just yet:
# 'yarn': 'dist/yarn.js',
# 'yarnpkg': 'dist/yarn.js',
@@ -147,7 +147,7 @@ def subdir_files(path, dest, action):
def files(action):
is_windows = sys.platform == 'win32'
- output_file = 'node'
+ output_file = 'node21'
output_prefix = 'out/Release/'
if is_windows:
@@ -189,7 +189,7 @@ def files(action):
if 'freebsd' in sys.platform or 'openbsd' in sys.platform:
action(['doc/node.1'], 'man/man1/')
else:
- action(['doc/node.1'], 'share/man/man1/')
+ action(['doc/node.1'], 'share/man/man1/node21.1')
if 'true' == variables.get('node_install_npm'):
npm_files(action)
@@ -276,28 +276,28 @@ def headers(action):
'src/node_buffer.h',
'src/node_object_wrap.h',
'src/node_version.h',
- ], 'include/node/')
+ ], 'include/node21/')
# Add the expfile that is created on AIX
if sys.platform.startswith('aix') or sys.platform == "os400":
- action(['out/Release/node.exp'], 'include/node/')
+ action(['out/Release/node.exp'], 'include/node21/')
- subdir_files('deps/v8/include', 'include/node/', wanted_v8_headers)
+ subdir_files('deps/v8/include', 'include/node21/', wanted_v8_headers)
if 'false' == variables.get('node_shared_libuv'):
- subdir_files('deps/uv/include', 'include/node/', action)
+ subdir_files('deps/uv/include', 'include/node21/', action)
if 'true' == variables.get('node_use_openssl') and \
'false' == variables.get('node_shared_openssl'):
- subdir_files('deps/openssl/openssl/include/openssl', 'include/node/openssl/', action)
- subdir_files('deps/openssl/config/archs', 'include/node/openssl/archs', action)
- subdir_files('deps/openssl/config', 'include/node/openssl', action)
+ subdir_files('deps/openssl/openssl/include/openssl', 'include/node21/openssl/', action)
+ subdir_files('deps/openssl/config/archs', 'include/node21/openssl/archs', action)
+ subdir_files('deps/openssl/config', 'include/node21/openssl', action)
if 'false' == variables.get('node_shared_zlib'):
action([
'deps/zlib/zconf.h',
'deps/zlib/zlib.h',
- ], 'include/node/')
+ ], 'include/node21/')
if sys.platform == 'zos':
zoslibinc = os.environ.get('ZOSLIB_INCLUDES')
Index: node-v20.5.1/doc/node.1
===================================================================
--- node-v20.5.1.orig/doc/node.1
+++ node-v20.5.1/doc/node.1
@@ -31,24 +31,24 @@
.Dt NODE 1
.
.Sh NAME
-.Nm node
+.Nm node21
.Nd server-side JavaScript runtime
.
.\"======================================================================
.Sh SYNOPSIS
-.Nm node
+.Nm node21
.Op Ar options
.Op Ar v8-options
.Op Fl e Ar string | Ar script.js | Fl
.Op Fl -
.Op Ar arguments ...
.
-.Nm node
+.Nm node21
.Cm inspect
.Op Fl e Ar string | Ar script.js | Fl | Ar <host>:<port>
.Ar ...
.
-.Nm node
+.Nm node21
.Op Fl -v8-options
.
.\"======================================================================
Index: node-v20.5.1/src/node_main.cc
===================================================================
--- node-v20.5.1.orig/src/node_main.cc
+++ node-v20.5.1/src/node_main.cc
@@ -94,6 +94,7 @@ int wmain(int argc, wchar_t* wargv[]) {
// UNIX
int main(int argc, char* argv[]) {
+ setenv("NODE_VERSION", "21", 0);
return node::Start(argc, argv);
}
#endif
Index: node-v20.5.1/tools/test.py
===================================================================
--- node-v20.5.1.orig/tools/test.py
+++ node-v20.5.1/tools/test.py
@@ -947,7 +947,7 @@ class Context(object):
if self.vm is not None:
return self.vm
if arch == 'none':
- name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node'
+ name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node21'
else:
name = 'out/%s.%s/node' % (arch, mode)
Index: node-v20.5.1/node.gyp
===================================================================
--- node-v20.5.1.orig/node.gyp
+++ node-v20.5.1/node.gyp
@@ -23,8 +23,8 @@
'node_shared_openssl%': 'false',
'node_v8_options%': '',
'node_enable_v8_vtunejit%': 'false',
- 'node_core_target_name%': 'node',
- 'node_lib_target_name%': 'libnode',
+ 'node_core_target_name%': 'node21',
+ 'node_lib_target_name%': 'libnode21',
'node_intermediate_lib_type%': 'static_library',
'node_builtin_modules_path%': '',
'linked_module_files': [