Update to 18.20.1

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2024-04-09 13:19:27 -04:00
parent bac0aa8624
commit a290f7bc54
5 changed files with 5841 additions and 132 deletions

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,6 @@
# ARG_POSITIONAL_SINGLE([version],[Node.js release version])
# ARG_OPTIONAL_BOOLEAN([push],[],[Whether to upload to the lookaside cache],[on])
# ARG_OPTIONAL_BOOLEAN([debug],[],[Print all commands],[off])
# ARG_OPTIONAL_SINGLE([undici-wasi-sdk-version],[],[Override the wasi-sdk version for undici])
# ARG_DEFAULTS_POS([])
# ARG_HELP([Tool to aid in Node.js packaging of new releases])
# ARGBASH_GO()
@ -38,17 +37,15 @@ _arg_version=
# THE DEFAULTS INITIALIZATION - OPTIONALS
_arg_push="on"
_arg_debug="off"
_arg_undici_wasi_sdk_version=
print_help()
{
printf '%s\n' "Tool to aid in Node.js packaging of new releases"
printf 'Usage: %s [--(no-)push] [--(no-)debug] [--undici-wasi-sdk-version <arg>] [-h|--help] <version>\n' "$0"
printf 'Usage: %s [--(no-)push] [--(no-)debug] [-h|--help] <version>\n' "$0"
printf '\t%s\n' "<version>: Node.js release version"
printf '\t%s\n' "--push, --no-push: Whether to upload to the lookaside cache (on by default)"
printf '\t%s\n' "--debug, --no-debug: Print all commands (off by default)"
printf '\t%s\n' "--undici-wasi-sdk-version: Override the wasi-sdk version for undici (no default)"
printf '\t%s\n' "-h, --help: Prints help"
}
@ -68,14 +65,6 @@ parse_commandline()
_arg_debug="on"
test "${1:0:5}" = "--no-" && _arg_debug="off"
;;
--undici-wasi-sdk-version)
test $# -lt 2 && die "Missing value for the optional argument '$_key'." 1
_arg_undici_wasi_sdk_version="$2"
shift
;;
--undici-wasi-sdk-version=*)
_arg_undici_wasi_sdk_version="${_key##--undici-wasi-sdk-version=}"
;;
-h|--help)
print_help
exit 0
@ -159,8 +148,14 @@ fi
FEDORA_DEFAULT_RELEASE_LOW=$((NODE_PKG_MAJOR + 19))
FEDORA_DEFAULT_RELEASE_HIGH=$((NODE_PKG_MAJOR + 20))
if [[ $((NODE_PKG_MAJOR)) -eq 20 ]]
then RHEL_DEFAULT_RELEASE=" || 0%{?rhel} == 10"
if [[ $((NODE_PKG_MAJOR)) -eq 20 ]]; then
RHEL_DEFAULT_RELEASE=" || 0%{?rhel} == 10"
fi
# Handle the situation where the next stable release of Node.js isn't yet
# available to include.
if [[ $((NODE_PKG_MAJOR)) -eq 20 ]]; then
TEMPORARY_RELEASE=" || 0%{?fedora} == 41 || 0%{?rhel} >= 11"
fi
rm -rf node-v${version}.tar.gz \
@ -183,43 +178,11 @@ tar -zxf node-v${version}.tar.gz
rm -rf node-v${version}/deps/openssl
tar -zcf node-v${version}-stripped.tar.gz node-v${version}
# Download the cjs-module-lexer sources
# Record the bundled cjs-module-lexer version
LEXER_VERSION=$(jq -r '.version' node-v${version}/deps/cjs-module-lexer/package.json)
wget https://github.com/nodejs/cjs-module-lexer/archive/refs/tags/${LEXER_VERSION}.tar.gz
tar -zxf ${LEXER_VERSION}.tar.gz
rm -f cjs-module-lexer-${LEXER_VERSION}/lib/lexer.wasm
tar -zcf cjs-module-lexer-${LEXER_VERSION}-stripped.tar.gz cjs-module-lexer-${LEXER_VERSION}/
rm -f ${LEXER_VERSION}.tar.gz
# Download the WASI compiler used to build cjs-module-lexer
LEXER_WASI_MAJOR=$(grep -oP '(?<=^\W../wasi-sdk-)\d+\.\d+' cjs-module-lexer-${LEXER_VERSION}/Makefile | cut -d'.' -f1)
LEXER_WASI_MINOR=$(grep -oP '(?<=^\W../wasi-sdk-)\d+\.\d+' cjs-module-lexer-${LEXER_VERSION}/Makefile | cut -d'.' -f2)
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${LEXER_WASI_MAJOR}/wasi-sdk-${LEXER_WASI_MAJOR}.${LEXER_WASI_MINOR}-linux.tar.gz
rm -rf cjs-module-lexer-${LEXER_VERSION}/
# Download the undici sources
# Record the bundled undici version
UNDICI_VERSION=$(jq -r '.version' node-v${version}/deps/undici/src/package.json)
wget https://github.com/nodejs/undici/archive/refs/tags/v${UNDICI_VERSION}.tar.gz
tar -zxf v${UNDICI_VERSION}.tar.gz
rm -f undici-${UNDICI_VERSION}/lib/llhttp/llhttp*.wasm*
tar -zcf undici-${UNDICI_VERSION}-stripped.tar.gz undici-${UNDICI_VERSION}/
rm -f v${UNDICI_VERSION}.tar.gz
# Download the WASI compiler used to build undici
if [ -z $_arg_undici_wasi_sdk_version ]; then
UNDICI_WASI_MAJOR=$(grep -oP '(?<=WASI_SDK_VERSION_MAJOR=).*' undici-${UNDICI_VERSION}/build/Dockerfile)
UNDICI_WASI_MINOR=$(grep -oP '(?<=WASI_SDK_VERSION_MINOR=).*' undici-${UNDICI_VERSION}/build/Dockerfile)
else
OIFS=$IFS
IFS="."
UNDICI_WASI_VERSION=($_arg_undici_wasi_sdk_version)
UNDICI_WASI_MAJOR=${UNDICI_WASI_VERSION[0]}
UNDICI_WASI_MINOR=${UNDICI_WASI_VERSION[1]}
IFS=$OIFS
fi
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${UNDICI_WASI_MAJOR}/wasi-sdk-${UNDICI_WASI_MAJOR}.${UNDICI_WASI_MINOR}-linux.tar.gz
rm -rf undici-${UNDICI_VERSION}/
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')
@ -273,17 +236,32 @@ UV_MAJOR=$(grep -oP '(?<=#define UV_VERSION_MAJOR )\d+' node-v${version}/deps/uv
UV_MINOR=$(grep -oP '(?<=#define UV_VERSION_MINOR )\d+' node-v${version}/deps/uv/include/uv/version.h)
UV_PATCH=$(grep -oP '(?<=#define UV_VERSION_PATCH )\d+' node-v${version}/deps/uv/include/uv/version.h)
LIBUV_VERSION="${UV_MAJOR}.${UV_MINOR}.${UV_PATCH}"
echo $UV_VERSION
echo $LIBUV_VERSION
echo
echo "nghttp2"
echo "========================="
NGHTTP2_VERSION=$(grep -oP '(?<=#define NGHTTP2_VERSION ).*\"' node-v${version}/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h |sed -e 's/^"//' -e 's/"$//')
echo $NGHTTP2_VERSION
echo
echo "nghttp3"
echo "========================="
NGHTTP3_VERSION=$(grep -oP '(?<=#define NGHTTP3_VERSION ).*\"' node-v${version}/deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h |sed -e 's/^"//' -e 's/"$//')
echo $NGHTTP3_VERSION
echo
echo "ngtcp2"
echo "========================="
NGTCP2_VERSION=$(grep -oP '(?<=#define NGTCP2_VERSION ).*\"' node-v${version}/deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h |sed -e 's/^"//' -e 's/"$//')
echo $NGTCP2_VERSION
echo
echo "ICU"
echo "========================="
echo "${ICU_MAJOR}.${ICU_MINOR}"
echo
echo "simdutf"
echo "========================="
SIMDUTF_VERSION=$(grep -oP '(?<=#define SIMDUTF_VERSION ).*\"' node-v${version}/deps/simdutf/simdutf.h |sed -e 's/^"//' -e 's/"$//')
echo $SIMDUTF_VERSION
echo
echo "punycode"
echo "========================="
PUNYCODE_VERSION=$(/usr/bin/node -e "console.log(require('punycode').version)")
@ -310,12 +288,10 @@ echo
echo "cjs-module-lexer"
echo "========================="
echo "${LEXER_VERSION}"
echo "WASI-SDK: ${LEXER_WASI_MAJOR}.${LEXER_WASI_MINOR}"
echo
echo "undici"
echo "========================="
echo "${UNDICI_VERSION}"
echo "WASI-SDK: ${UNDICI_WASI_MAJOR}.${UNDICI_WASI_MINOR}"
echo
echo "ada"
echo "========================="
@ -337,6 +313,7 @@ IFS='' read -r -d '' template_json <<EOF
"NODE_PATCH": $NODE_PATCH,
"FEDORA_DEFAULT_RELEASE_LOW": $FEDORA_DEFAULT_RELEASE_LOW,
"FEDORA_DEFAULT_RELEASE_HIGH": $FEDORA_DEFAULT_RELEASE_HIGH,
"TEMPORARY_RELEASE": "$TEMPORARY_RELEASE",
"RHEL_DEFAULT_RELEASE": "$RHEL_DEFAULT_RELEASE",
"NODE_SOVERSION": $NODE_SOVERSION,
"V8_MAJOR": $V8_MAJOR,
@ -347,18 +324,17 @@ IFS='' read -r -d '' template_json <<EOF
"LLHTTP_VERSION": $LLHTTP_VERSION,
"LIBUV_VERSION": $LIBUV_VERSION,
"NGHTTP2_VERSION": $NGHTTP2_VERSION,
"NGHTTP3_VERSION": $NGHTTP3_VERSION,
"NGTCP2_VERSION": $NGTCP2_VERSION,
"ICU_MAJOR": $ICU_MAJOR,
"ICU_MINOR": $ICU_MINOR,
"SIMDUTF_VERSION": $SIMDUTF_VERSION,
"PUNYCODE_VERSION": $PUNYCODE_VERSION,
"UVWASI_VERSION": $UVWASI_VERSION,
"NPM_VERSION": $NPM_VERSION,
"ZLIB_VERSION": $ZLIB_VERSION,
"LEXER_VERSION": $LEXER_VERSION,
"LEXER_WASI_MAJOR": $LEXER_WASI_MAJOR,
"LEXER_WASI_MINOR": $LEXER_WASI_MINOR,
"UNDICI_VERSION": $UNDICI_VERSION,
"UNDICI_WASI_MAJOR": $UNDICI_WASI_MAJOR,
"UNDICI_WASI_MINOR": $UNDICI_WASI_MINOR,
"ADA_VERSION": $ADA_VERSION,
"PATCHES": $json_patchlist
}
@ -369,11 +345,7 @@ echo ${template_json} | jinja2 ${SCRIPT_DIR}/packaging/nodejs.spec.j2 \
if [ $_arg_push = 'on' ]; then
fedpkg new-sources node-v${version}-stripped.tar.gz \
icu4c-${ICU_MAJOR}_${ICU_MINOR}-data-bin-*.zip \
cjs-module-lexer-${LEXER_VERSION}-stripped.tar.gz \
wasi-sdk-${LEXER_WASI_MAJOR}.${LEXER_WASI_MINOR}-linux.tar.gz \
undici-${UNDICI_VERSION}-stripped.tar.gz \
wasi-sdk-${UNDICI_WASI_MAJOR}.${UNDICI_WASI_MINOR}-linux.tar.gz
icu4c-${ICU_MAJOR}_${ICU_MINOR}-data-bin-*.zip
fi
rm -rf node-v${version}

View file

@ -1,3 +1,6 @@
# Break circular dependencies
%bcond bootstrap 0
%if 0%{?rhel} && 0%{?rhel} < 8
%bcond_without bundled_zlib
%else
@ -26,8 +29,8 @@
# than a Fedora release lifecycle.
%global nodejs_epoch 1
%global nodejs_major 18
%global nodejs_minor 19
%global nodejs_patch 0
%global nodejs_minor 20
%global nodejs_patch 1
# nodejs_soversion - from NODE_MODULE_VERSION in src/node_version.h
%global nodejs_soversion 108
%global nodejs_abi %{nodejs_soversion}
@ -61,14 +64,14 @@
%global v8_release %{nodejs_epoch}.%{nodejs_major}.%{nodejs_minor}.%{nodejs_patch}.%{nodejs_release}
# zlib - from deps/zlib/zlib.h
%global zlib_version 1.2.13.1-motley
%global zlib_version 1.3.0.1-motley
# c-ares - from deps/cares/include/ares_version.h
# https://github.com/nodejs/node/pull/9332
%global c_ares_version 1.20.1
%global c_ares_version 1.27.0
# llhttp - from deps/llhttp/include/llhttp.h
%global llhttp_version 6.0.11
%global llhttp_version 6.1.1
# libuv - from deps/uv/include/uv/version.h
%global libuv_version 1.44.2
@ -76,8 +79,14 @@
# nghttp2 - from deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
%global nghttp2_version 1.57.0
# nghttp3 - from deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h
%global nghttp3_version 0.7.0
# ngtcp2 from deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h
%global ngtcp2_version 0.8.1
# ICU - from tools/icu/current_ver.dep
%global icu_major 73
%global icu_major 74
%global icu_minor 2
%global icu_version %{icu_major}.%{icu_minor}
@ -85,6 +94,8 @@
%{!?little_endian: %global little_endian %(%{python3} -c "import sys;print (0 if sys.byteorder=='big' else 1)")}
# " this line just fixes syntax highlighting for vim that is confused by the above and continues literal
# simdutf from deps/simdutf/simdutf.h
%global simdutf_version 4.0.8
# OpenSSL minimum version
%global openssl11_minimum 1:1.1.1
@ -97,7 +108,7 @@
# npm - from deps/npm/package.json
%global npm_epoch 1
%global npm_version 10.2.3
%global npm_version 10.5.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
@ -119,7 +130,8 @@ Epoch: %{nodejs_epoch}
Version: %{nodejs_version}
Release: %{nodejs_release}
Summary: JavaScript runtime
License: MIT and ASL 2.0 and ISC and BSD
# see bundled_licenses.py, which helps identify licenses in bundled NPM modules
License: Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
Group: Development/Languages
URL: http://nodejs.org/
@ -139,16 +151,8 @@ Source201: npmrc.builtin.in
Source202: nodejs.pc.in
Source203: v8.pc.in
# These are full sources for dependencies included as WASM blobs in the source of Node itself.
# Note: These sources would also include pre-compiled WASM blobs… so they are adjusted not to.
# Recipes for creating these blobs are included in the sources.
# These are generated by nodejs-sources.sh
Source101: cjs-module-lexer-1.2.2-stripped.tar.gz
Source102: wasi-sdk-11.0-linux.tar.gz
Source111: undici-5.26.4-stripped.tar.gz
Source112: wasi-sdk-20.0-linux.tar.gz
Patch: 0001-Fedora-specific-patches.patch
Patch: 0001-simdutf-cpu-feature-detection-fixes.patch
%if 0%{?nodejs_default}
%global pkgname nodejs
@ -205,6 +209,7 @@ Provides: nodejs = %{nodejs_envr}
# replace nodejs20-20.6.0.
%define unversioned_obsoletes_of_nodejsXX_if_default() %{expand:\
Obsoletes: nodejs%{nodejs_pkg_major}%{?1:-%{1}}\
Provides: nodejs%{nodejs_pkg_major}%{?1:-%{1}} = %{nodejs_envr}\
}
%else
%define unversioned_obsoletes_of_nodejsXX_if_default() %{nil}
@ -220,6 +225,8 @@ Requires: libuv >= 1:%{libuv_version}
# Node.js frequently bumps this faster than Fedora can follow,
# so we will bundle it.
Provides: bundled(nghttp2) = %{nghttp2_version}
Provides: bundled(nghttp3) = %{nghttp3_version}
Provides: bundled(ngtcp2) = %{ngtcp2_version}
# Temporarily bundle llhttp because the upstream doesn't
# provide releases for it.
@ -311,12 +318,22 @@ Provides: bundled(icu) = %{icu_version}
# or there's no option to built it as a shared dependency, so we bundle them
Provides: bundled(uvwasi) = %{uvwasi_version}
Provides: bundled(histogram) = %{histogram_version}
Provides: bundled(simdutf) = %{simdutf_version}
# Upstream has added a new URL parser that has no option to build as a shared
# library (19.7.0+)
Provides: bundled(ada) = 2.7.2
Provides: bundled(ada) = 2.7.6
# undici and cjs-module-lexer ship with pre-built WASM binaries.
%if %{with bootstrap}
Provides: bundled(nodejs-cjs-module-lexer) = 1.2.2
Provides: bundled(nodejs-undici) = 5.28.4
%else
BuildRequires: nodejs-cjs-module-lexer nodejs-undici
Requires: nodejs-cjs-module-lexer nodejs-undici
%endif
%unversioned_obsoletes_of_nodejsXX_if_default
@ -446,8 +463,12 @@ Provides: npm = %{npm_envr}
# Obsolete the old 'npm' package
Obsoletes: npm < 1:9
# Obsolete others. We can't use %%unversioned_obsoletes_of_nodejsXX_if_default
# here because the Provides: needs its own version
Obsoletes: nodejs%{nodejs_pkg_major}-npm
Provides: nodejs%{nodejs_pkg_major}-npm = %{npm_envr}
%endif
%unversioned_obsoletes_of_nodejsXX_if_default npm
%description -n %{pkgname}-npm
@ -481,21 +502,10 @@ rm -rf deps/brotli
rm -rf deps/v8/third_party/jinja2
rm -rf tools/inspector_protocol/jinja2
# check for correct versions of dependencies we are bundling
check_wasm_dep() {
local -r name="$1" source="$2" packagejson="$3"
local -r expected_version="$(jq -r '.version' "${packagejson}")"
if ls "${source}"|grep -q --fixed-strings "${expected_version}"; then
printf '%s version matches\n' "${name}" >&2
else
printf '%s version MISMATCH: %s !~ %s\n' "${name}" "${expected_version}" "${source}" >&2
return 1
fi
}
check_wasm_dep cjs-module-lexer '%{SOURCE101}' deps/cjs-module-lexer/package.json
check_wasm_dep undici '%{SOURCE111}' deps/undici/src/package.json
%if %{without bootstrap}
rm -rf deps/cjs-module-lexer
rm -rf deps/undici
%endif
# Replace any instances of unversioned python with python3
pfiles=( $(grep -rl python) )
@ -557,6 +567,9 @@ export PATH="${cwd}/.bin:$PATH"
%{ssl_configure} \
%{dtrace_configure} \
%{!?with_bundled_zlib:--shared-zlib} \
%{!?with_bootstrap:--shared-builtin-cjs_module_lexer/lexer-path %{nodejs_default_sitelib}/cjs-module-lexer/lexer.js} \
%{!?with_bootstrap:--shared-builtin-cjs_module_lexer/dist/lexer-path %{nodejs_default_sitelib}/cjs-module-lexer/dist/lexer.js} \
%{!?with_bootstrap:--shared-builtin-undici/undici-path %{nodejs_default_sitelib}/undici/loader.js} \
--shared-brotli \
--shared-libuv \
--with-intl=small-icu \
@ -572,7 +585,12 @@ export PATH="${cwd}/.bin:$PATH"
# 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/
%if 0%{?nodejs_major} >= 20
./tools/install.py install --dest-dir %{buildroot} --prefix %{_prefix}
%else
./tools/install.py install %{buildroot} %{_prefix}
%endif
# own the sitelib directory
@ -827,7 +845,7 @@ end
%endif
%{_bindir}/node-%{nodejs_pkg_major}
%{nodejs_private_sitelib}
%dir %{nodejs_private_sitelib}
%doc %{_mandir}/nodejs-%{nodejs_pkg_major}/man1/node.1*

View file

@ -1,3 +1,6 @@
# Break circular dependencies
%bcond bootstrap 0
%if 0%{?rhel} && 0%{?rhel} < 8
%bcond_without bundled_zlib
%else
@ -41,7 +44,7 @@
# Determine if this should be the default version for this Fedora release
# The default version will own /usr/bin/node and friends
%if 0%{?fedora} == {{ FEDORA_DEFAULT_RELEASE_LOW }} || 0%{?fedora} == {{ FEDORA_DEFAULT_RELEASE_HIGH }}{{ RHEL_DEFAULT_RELEASE }}
%if 0%{?fedora} == {{ FEDORA_DEFAULT_RELEASE_LOW }} || 0%{?fedora} == {{ FEDORA_DEFAULT_RELEASE_HIGH }}{{ RHEL_DEFAULT_RELEASE }}{{ TEMPORARY_RELEASE }}
%global nodejs_default %{nodejs_pkg_major}
%endif
@ -76,6 +79,12 @@
# nghttp2 - from deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
%global nghttp2_version {{ NGHTTP2_VERSION }}
# nghttp3 - from deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h
%global nghttp3_version {{NGHTTP3_VERSION}}
# ngtcp2 from deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h
%global ngtcp2_version {{NGTCP2_VERSION}}
# ICU - from tools/icu/current_ver.dep
%global icu_major {{ ICU_MAJOR }}
%global icu_minor {{ ICU_MINOR }}
@ -85,6 +94,8 @@
%{!?little_endian: %global little_endian %(%{python3} -c "import sys;print (0 if sys.byteorder=='big' else 1)")}
# " this line just fixes syntax highlighting for vim that is confused by the above and continues literal
# simdutf from deps/simdutf/simdutf.h
%global simdutf_version {{SIMDUTF_VERSION}}
# OpenSSL minimum version
%global openssl11_minimum 1:1.1.1
@ -119,7 +130,8 @@ Epoch: %{nodejs_epoch}
Version: %{nodejs_version}
Release: %{nodejs_release}
Summary: JavaScript runtime
License: MIT and ASL 2.0 and ISC and BSD
# see bundled_licenses.py, which helps identify licenses in bundled NPM modules
License: Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
Group: Development/Languages
URL: http://nodejs.org/
@ -139,15 +151,6 @@ Source201: npmrc.builtin.in
Source202: nodejs.pc.in
Source203: v8.pc.in
# These are full sources for dependencies included as WASM blobs in the source of Node itself.
# Note: These sources would also include pre-compiled WASM blobs… so they are adjusted not to.
# Recipes for creating these blobs are included in the sources.
# These are generated by nodejs-sources.sh
Source101: cjs-module-lexer-{{ LEXER_VERSION }}-stripped.tar.gz
Source102: wasi-sdk-{{ LEXER_WASI_MAJOR }}.{{ LEXER_WASI_MINOR }}-linux.tar.gz
Source111: undici-{{ UNDICI_VERSION }}-stripped.tar.gz
Source112: wasi-sdk-{{ UNDICI_WASI_MAJOR }}.{{ UNDICI_WASI_MINOR }}-linux.tar.gz
{% for patch in PATCHES -%}
Patch: {{ patch }}
{% endfor -%}
@ -208,6 +211,7 @@ Provides: nodejs = %{nodejs_envr}
# replace nodejs20-20.6.0.
%define unversioned_obsoletes_of_nodejsXX_if_default() %{expand:\
Obsoletes: nodejs%{nodejs_pkg_major}%{?1:-%{1}}\
Provides: nodejs%{nodejs_pkg_major}%{?1:-%{1}} = %{nodejs_envr}\
}
%else
%define unversioned_obsoletes_of_nodejsXX_if_default() %{nil}
@ -223,6 +227,8 @@ Requires: libuv >= 1:%{libuv_version}
# Node.js frequently bumps this faster than Fedora can follow,
# so we will bundle it.
Provides: bundled(nghttp2) = %{nghttp2_version}
Provides: bundled(nghttp3) = %{nghttp3_version}
Provides: bundled(ngtcp2) = %{ngtcp2_version}
# Temporarily bundle llhttp because the upstream doesn't
# provide releases for it.
@ -318,6 +324,7 @@ Provides: bundled(icu) = %{icu_version}
# or there's no option to built it as a shared dependency, so we bundle them
Provides: bundled(uvwasi) = %{uvwasi_version}
Provides: bundled(histogram) = %{histogram_version}
Provides: bundled(simdutf) = %{simdutf_version}
{% if ADA_VERSION -%}
# Upstream has added a new URL parser that has no option to build as a shared
@ -325,6 +332,15 @@ Provides: bundled(histogram) = %{histogram_version}
Provides: bundled(ada) = {{ ADA_VERSION }}
{% endif %}
# undici and cjs-module-lexer ship with pre-built WASM binaries.
%if %{with bootstrap}
Provides: bundled(nodejs-cjs-module-lexer) = {{ LEXER_VERSION }}
Provides: bundled(nodejs-undici) = {{ UNDICI_VERSION }}
%else
BuildRequires: nodejs-cjs-module-lexer nodejs-undici
Requires: nodejs-cjs-module-lexer nodejs-undici
%endif
%unversioned_obsoletes_of_nodejsXX_if_default
@ -454,8 +470,12 @@ Provides: npm = %{npm_envr}
# Obsolete the old 'npm' package
Obsoletes: npm < 1:9
# Obsolete others. We can't use %%unversioned_obsoletes_of_nodejsXX_if_default
# here because the Provides: needs its own version
Obsoletes: nodejs%{nodejs_pkg_major}-npm
Provides: nodejs%{nodejs_pkg_major}-npm = %{npm_envr}
%endif
%unversioned_obsoletes_of_nodejsXX_if_default npm
%description -n %{pkgname}-npm
@ -489,21 +509,10 @@ rm -rf deps/brotli
rm -rf deps/v8/third_party/jinja2
rm -rf tools/inspector_protocol/jinja2
# check for correct versions of dependencies we are bundling
check_wasm_dep() {
local -r name="$1" source="$2" packagejson="$3"
local -r expected_version="$(jq -r '.version' "${packagejson}")"
if ls "${source}"|grep -q --fixed-strings "${expected_version}"; then
printf '%s version matches\n' "${name}" >&2
else
printf '%s version MISMATCH: %s !~ %s\n' "${name}" "${expected_version}" "${source}" >&2
return 1
fi
}
check_wasm_dep cjs-module-lexer '%{SOURCE101}' deps/cjs-module-lexer/package.json
check_wasm_dep undici '%{SOURCE111}' deps/undici/src/package.json
%if %{without bootstrap}
rm -rf deps/cjs-module-lexer
rm -rf deps/undici
%endif
# Replace any instances of unversioned python with python3
pfiles=( $(grep -rl python) )
@ -565,6 +574,9 @@ export PATH="${cwd}/.bin:$PATH"
%{ssl_configure} \
%{dtrace_configure} \
%{!?with_bundled_zlib:--shared-zlib} \
%{!?with_bootstrap:--shared-builtin-cjs_module_lexer/lexer-path %{nodejs_default_sitelib}/cjs-module-lexer/lexer.js} \
%{!?with_bootstrap:--shared-builtin-cjs_module_lexer/dist/lexer-path %{nodejs_default_sitelib}/cjs-module-lexer/dist/lexer.js} \
%{!?with_bootstrap:--shared-builtin-undici/undici-path %{nodejs_default_sitelib}/undici/loader.js} \
--shared-brotli \
--shared-libuv \
--with-intl=small-icu \
@ -580,7 +592,12 @@ export PATH="${cwd}/.bin:$PATH"
# 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/
%if 0%{?nodejs_major} >= 20
./tools/install.py install --dest-dir %{buildroot} --prefix %{_prefix}
%else
./tools/install.py install %{buildroot} %{_prefix}
%endif
# own the sitelib directory
@ -836,7 +853,7 @@ end
%endif
%{_bindir}/node-%{nodejs_pkg_major}
%{nodejs_private_sitelib}
%dir %{nodejs_private_sitelib}
%doc %{_mandir}/nodejs-%{nodejs_pkg_major}/man1/node.1*

10
sources
View file

@ -1,7 +1,3 @@
SHA512 (node-v18.19.0-stripped.tar.gz) = c7bad22d4b6b24335f2032a5b01529992bb454fc1bb02c57324472438e958205a60d7a91ffc21550e2d69cebea07305cd43fbd997ec691cb163544c287721952
SHA512 (icu4c-73_2-data-bin-b.zip) = 8512947da7b2a927627abed6bd7e04218cd4fcd02d44eb72a82ffa87aedabfc3be5d3152e9fba33a769ef35e2db55764c2ab8f5bd65b4e89aa9c15b33392e078
SHA512 (icu4c-73_2-data-bin-l.zip) = 420c2f5090927dab13f5449da3b0ec7bf86a91ea8723f177aca2907a8eea9bcb4c3475b66c54355ae320001813db57a00afdab00bd85b8c36d39adedcab80bfc
SHA512 (cjs-module-lexer-1.2.2-stripped.tar.gz) = 5a6ccb2d807bafe17be7c34615b498d54ccdbc04faf3e21da28c721b0d4c9a2962275c3edacbec9e05ea83958fefc226d66183ba2dfc56988d2f2b607889bfd0
SHA512 (wasi-sdk-11.0-linux.tar.gz) = e3ed4597f7f2290967eef6238e9046f60abbcb8633a4a2a51525d00e7393df8df637a98a5b668217d332dd44fcbf2442ec7efd5e65724e888d90611164451e20
SHA512 (undici-5.26.4-stripped.tar.gz) = 2a72a432cdcb22a63e9d498079149b4a01226c96ec04c0e4a37436d4dfdcad250054f3b847d3c6f568d1fe50a05e34c77734f406869efdfdaca75f89090ef640
SHA512 (wasi-sdk-20.0-linux.tar.gz) = ff3d368267526887534f50767ff010bd368e9c24178ab2f0cf57a8ed0b3a82fbf85986d620ab2327ac6bb3f456c65adc6edb80626a1289e630dde7e43b191b42
SHA512 (node-v18.20.1-stripped.tar.gz) = ef0489d9cddbb56c9f2fd6b988098aa2475bb6daecbff96a8a0c31f1e4e87db9aed078120bce3a9025267c0d241a62eea1db42791947e8722b1bad2fbd90d329
SHA512 (icu4c-74_2-data-bin-b.zip) = 76cc9a684be584ce2bd674b40191975a7506ef14c9c7a08cfe0a09d28c90e49529a2eb01baf698cf27895bec9f8fdf6b76c1d1bd010607fac04be7d12e954e50
SHA512 (icu4c-74_2-data-bin-l.zip) = 6ef1554c0af06cec777c454cbbeaca44884b8db028d777311323d44e5697a7638df394cfc53760ddcdab763d975f24043f47ac4828e20c9774b4108030a7be15