Update to Node.js 14.20.0

https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md#14.20.0
Switch build-system to ninja

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2022-08-15 17:48:01 -04:00
parent 6676c988e4
commit 3dd7b0d052
No known key found for this signature in database
GPG Key ID: 45DB85A568286D11
4 changed files with 57 additions and 64 deletions

2
.gitignore vendored
View File

@ -7,3 +7,5 @@
/.build-*.log
/noarch
/x86_64
/icu4c-70_1-data-bin-b.zip
/icu4c-70_1-data-bin-l.zip

View File

@ -100,6 +100,12 @@ assign_positional_args 1 "${_positionals[@]}"
### END OF CODE GENERATED BY Argbash (sortof) ### ])
# [ <-- needed because of Argbash
packages=("jq" "wget" "tar" "fedpkg" "grep" "sed")
rpm -q ${packages[@]} >/dev/null
if [ $? -ne 0 ]; then
sudo dnf -y install ${packages[@]}
fi
set -e
@ -119,19 +125,21 @@ wget http://nodejs.org/dist/v${version}/node-v${version}.tar.gz \
http://nodejs.org/dist/v${version}/SHASUMS256.txt
sha256sum -c SHASUMS256.txt --ignore-missing
tar -zxf node-v${version}.tar.gz
# Remove bundled OpenSSL
# We will link to the system version
rm -rf node-v${version}/deps/openssl
tar -zcf node-v${version}-stripped.tar.gz node-v${version}
# Download the matching version of ICU
rm -f icu4c*-src.tgz icu.md5
ICUMD5=$(cat node-v${version}/tools/icu/current_ver.dep |jq -r '.[0].md5')
wget $(cat node-v${version}/tools/icu/current_ver.dep |jq -r '.[0].url')
ICUTARBALL=$(ls -1 icu4c*-src.tgz)
echo "$ICUMD5 $ICUTARBALL" > icu.md5
md5sum -c icu.md5
rm -f icu.md5 SHASUMS256.txt
ICU_MAJOR=$(jq -r '.[0].url' node-v${version}/tools/icu/current_ver.dep | sed --expression='s/.*release-\([[:digit:]]\+\)-\([[:digit:]]\+\).*/\1/g')
ICU_MINOR=$(jq -r '.[0].url' node-v${version}/tools/icu/current_ver.dep | sed --expression='s/.*release-\([[:digit:]]\+\)-\([[:digit:]]\+\).*/\2/g')
fedpkg new-sources node-v${version}-stripped.tar.gz icu4c*-src.tgz
# Download the ICU binary data files
rm -Rf icu4c-${ICU_MAJOR}_${ICU_MINOR}-data-bin-*.zip
wget $(grep Source3 nodejs.spec | sed --expression="s/.*http/http/g" --expression="s/\(\%{icu_major}\)/${ICU_MAJOR}/g" --expression="s/\(\%{icu_minor}\)/${ICU_MINOR}/g")
wget $(grep Source4 nodejs.spec | sed --expression="s/.*http/http/g" --expression="s/\(\%{icu_major}\)/${ICU_MAJOR}/g" --expression="s/\(\%{icu_minor}\)/${ICU_MINOR}/g")
fedpkg new-sources node-v${version}-stripped.tar.gz icu4c-${ICU_MAJOR}_${ICU_MINOR}-data-bin-*.zip
rm -f node-v${version}.tar.gz
@ -176,7 +184,7 @@ grep "define NGHTTP2_VERSION " node-v${version}/deps/nghttp2/lib/includes/nghttp
echo
echo "ICU"
echo "========================="
grep "url" node-v${version}/tools/icu/current_ver.dep
echo "${ICU_MAJOR}.${ICU_MINOR}"
echo
echo "punycode"
echo "========================="
@ -192,9 +200,9 @@ echo "npm"
echo "========================="
grep "\"version\":" node-v${version}/deps/npm/package.json
echo
echo "corepack"
echo "zlib"
echo "========================="
grep "\"version\":" node-v${version}/deps/corepack/package.json
grep "define ZLIB_VERSION" node-v${version}/deps/zlib/zlib.h
echo
echo "Make sure these versions match what is in the RPM spec file"

View File

@ -1,7 +1,7 @@
# bundle dependencies that are not available as Fedora modules
%bcond_with bootstrap
# LTO is currently broken on Node.js builds
# Node.js has its own way to enable LTS
%define _lto_cflags %{nil}
# == Master Relase ==
@ -19,8 +19,8 @@
# than a Fedora release lifecycle.
%global nodejs_epoch 1
%global nodejs_major 14
%global nodejs_minor 19
%global nodejs_patch 3
%global nodejs_minor 20
%global nodejs_patch 0
%global nodejs_abi %{nodejs_major}.%{nodejs_minor}
# nodejs_soversion - from NODE_MODULE_VERSION in src/node_version.h
%global nodejs_soversion 83
@ -52,7 +52,7 @@
# llhttp - from deps/llhttp/include/llhttp.h
%global llhttp_major 2
%global llhttp_minor 1
%global llhttp_patch 4
%global llhttp_patch 5
%global llhttp_version %{llhttp_major}.%{llhttp_minor}.%{llhttp_patch}
# libuv - from deps/uv/include/uv/version.h
@ -107,9 +107,6 @@
%global histogram_patch 7
%global histogram_version %{histogram_major}.%{histogram_minor}.%{histogram_patch}
# Node.js now comes with an experimental package management tool
%global corepack_version 0.10.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
# to increment safely. Changing this can only be done during an update when the
@ -134,8 +131,10 @@ ExclusiveArch: %{nodejs_arches}
Source0: node-v%{nodejs_version}-stripped.tar.gz
Source1: npmrc
Source2: btest402.js
Source3: https://github.com/unicode-org/icu/releases/download/release-%{icu_major}-%{icu_minor}/icu4c-%{icu_major}_%{icu_minor}-src.tgz
Source100: %{name}-tarball.sh
# The binary data that icu-small can use to get icu-full capability
Source3: https://github.com/unicode-org/icu/releases/download/release-%{icu_major}-%{icu_minor}/icu4c-%{icu_major}_%{icu_minor}-data-bin-b.zip
Source4: https://github.com/unicode-org/icu/releases/download/release-%{icu_major}-%{icu_minor}/icu4c-%{icu_major}_%{icu_minor}-data-bin-l.zip
Source100: %{name}-sources.sh
# The native module Requires generator remains in the nodejs SRPM, so it knows
# the nodejs and v8 versions. The remainder has migrated to the
@ -149,6 +148,7 @@ Patch1: 0001-Disable-running-gyp-on-shared-deps.patch
Patch2: 0002-Install-both-binaries-and-use-libdir.patch
BuildRequires: make
BuildRequires: ninja-build
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-jinja2
@ -366,17 +366,9 @@ rm -rf tools/inspector_protocol/jinja2
%build
# When compiled on armv7hl this package generates an out of range
# reference to the literal pool. This is most likely a GCC issue.
%ifarch armv7hl
%define _lto_cflags %{nil}
%endif
%ifarch s390 s390x %{arm} %ix86
# Decrease debuginfo verbosity to reduce memory consumption during final
# library linking
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif
export CC='%{__cc}'
export CXX='%{__cxx}'
@ -388,12 +380,14 @@ export CFLAGS='%{optflags} \
-D_LARGEFILE_SOURCE \
-D_FILE_OFFSET_BITS=64 \
-DZLIB_CONST \
-fno-delete-null-pointer-checks'
-fno-delete-null-pointer-checks \
-O3'
export CXXFLAGS='%{optflags} \
-D_LARGEFILE_SOURCE \
-D_FILE_OFFSET_BITS=64 \
-DZLIB_CONST \
-fno-delete-null-pointer-checks'
-fno-delete-null-pointer-checks\
-O3'
# Explicit new lines in C(XX)FLAGS can break naive build scripts
export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')"
@ -404,6 +398,7 @@ export LDFLAGS="%{build_ldflags}"
%if %{with bootstrap}
%{__python3} configure.py --prefix=%{_prefix} \
--shared \
--ninja \
--libdir=%{_lib} \
--shared-openssl \
--shared-zlib \
@ -414,6 +409,8 @@ export LDFLAGS="%{build_ldflags}"
%else
%{__python3} configure.py --prefix=%{_prefix} \
--shared \
--ninja \
--enable-lto \
--libdir=%{_lib} \
--shared-openssl \
--shared-zlib \
@ -426,41 +423,15 @@ export LDFLAGS="%{build_ldflags}"
--openssl-use-def-ca-store
%endif
make BUILDTYPE=Release %{?_smp_mflags}
# Extract the ICU data and convert it to the appropriate endianness
pushd deps/
tar xfz %SOURCE3
pushd icu/source
mkdir -p converted
%if 0%{?little_endian}
# The little endian data file is included in the ICU sources
install -Dpm0644 data/in/icudt%{icu_major}l.dat converted/
%else
# For the time being, we need to build ICU and use the included `icupkg` tool
# to convert the little endian data file into a big-endian one.
# At some point in the future, ICU releases will start including both data
# files and we should switch to those.
mkdir -p data/out/tmp
%configure
%make_build
icu_root=$(pwd)
LD_LIBRARY_PATH=./lib ./bin/icupkg -tb data/in/icudt%{icu_major}l.dat \
converted/icudt%{icu_major}b.dat
%endif
popd # icu/source
popd # deps
%ninja_build -C out/Release
%install
rm -rf %{buildroot}
# The ninja build does not put the shared library in the expected location, so
# we will move it.
mv out/Release/lib/libnode.so.%{nodejs_soversion} out/Release/
./tools/install.py install %{buildroot} %{_prefix}
# Set the binary permissions properly
@ -553,7 +524,13 @@ mkdir -p %{buildroot}%{_prefix}/etc
ln -s %{_sysconfdir}/npmrc %{buildroot}%{_prefix}/etc/npmrc
# Install the full-icu data files
install -Dpm0644 -t %{buildroot}%{icudatadir} deps/icu/source/converted/*
mkdir -p %{buildroot}%{icudatadir}
%if 0%{?little_endian}
unzip -d %{buildroot}%{icudatadir} %{SOURCE4} icudt%{icu_major}l.dat
%else
unzip -d %{buildroot}%{icudatadir} %{SOURCE3} icudt%{icu_major}b.dat
%endif
%check
@ -662,6 +639,11 @@ NODE_PATH=%{buildroot}%{_prefix}/lib/node_modules:%{buildroot}%{_prefix}/lib/nod
%changelog
* Fri Jul 15 2022 Stephen Gallagher <sgallagh@redhat.com> - 1:14.20.0-1
- Update to Node.js 14.20.0
- https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md#14.20.0
- Switch build-system to ninja
* Tue May 17 2022 Stephen Gallagher <sgallagh@redhat.com> - 1:14.19.3-1
- Update to Node.js 14.19.3
- https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md#14.19.3

View File

@ -1,2 +1,3 @@
SHA512 (node-v14.19.3-stripped.tar.gz) = f5c20af31d01f9774e76854f105676334741d4303d9ae0f930451c4ca987649aa3dac6aacb431e0fed727996888bd5b6a371d37f36cf8706a16bd0cdaa979396
SHA512 (icu4c-70_1-src.tgz) = 0b26ae7207155cb65a8fdb25f7b2fa4431e74b12bccbed0884a17feaae3c96833d12451064dd152197fd6ea5fd3adfd95594284a463e66c82e0d860f645880c9
SHA512 (node-v14.20.0-stripped.tar.gz) = 0b372847d485acc6bc90ddeca6afe06ab7a8e968b4f3e382f020f88a6f49e4400570be8d5405c07b59604147c51528aa866f97a0937f94e94b94b3abb6656674
SHA512 (icu4c-70_1-data-bin-b.zip) = eff9b41f1df4fe74e13bc216c62a8eab735622e3aa4e0b9c925b61f55294a002238a0022e1579197170d0345de6e877220b04b62d2010796f4ef1fbb2c17ea92
SHA512 (icu4c-70_1-data-bin-l.zip) = 041ff3480566330d043d9ddcd31e8851e875183d158ea3ce625583b4a9d96166497a9eedc0e72e2f7a3abc3a9110a0372546151b264ff4d1623215aab33552f5