From b3371818b9bea3e39b634cfddb34cb82948d93e9 Mon Sep 17 00:00:00 2001 From: "octo-sts[bot]" <157150467+octo-sts@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:19:21 +0000 Subject: [PATCH] nodejs-22:version stream --- nodejs-22.yaml | 106 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 nodejs-22.yaml diff --git a/nodejs-22.yaml b/nodejs-22.yaml new file mode 100644 index 0000000000..92e8787626 --- /dev/null +++ b/nodejs-22.yaml @@ -0,0 +1,106 @@ +package: + name: nodejs-22 + version: 22.0.0 + epoch: 0 + description: "JavaScript runtime built on V8 engine" + dependencies: + provides: + - nodejs=${{package.full-version}} + copyright: + - license: MIT + +environment: + contents: + packages: + - brotli-dev + - build-base + - busybox + - c-ares-dev + - ca-certificates-bundle + - icu-dev + - libuv-dev + - linux-headers + - nghttp2-dev + - openssl-dev + - py3-jinja2 + - py3-setuptools + - python3 + - samurai + - wolfi-base + - zlib-dev + +pipeline: + - uses: fetch + with: + uri: https://nodejs.org/dist/v${{package.version}}/node-v${{package.version}}.tar.gz + expected-sha256: 47cd57486564a8cb4728ec01f1d98b510c6547e19e96a7f7583cf882d803d0c6 + + - name: Configure and build + runs: | + # Add defines recommended in libuv readme. + common_flags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" + + # Compiling with O2 instead of Os increases binary size by ~10% + # (53.1 MiB -> 58.6 MiB), but also increases performance by ~20% + # according to v8/web-tooling-benchmark. Node.js is quite huge anyway; + # there are better options for size constrained environments. + export CFLAGS="${CFLAGS/-Os/-O2} $common_flags" + export CXXFLAGS="${CXXFLAGS/-Os/-O2} $common_flags" + export CPPFLAGS="${CPPFLAGS/-Os/-O2} $common_flags" + python3 configure.py --prefix=/usr \ + --shared-brotli \ + --shared-zlib \ + --shared-openssl \ + --shared-cares \ + --shared-nghttp2 \ + --shared-libuv \ + --ninja \ + --openssl-use-def-ca-store \ + --with-icu-default-data-dir=$(icu-config --icudatadir) \ + --with-intl=system-icu \ + --openssl-conf-name=openssl_conf \ + --without-corepack + + make BUILDTYPE=Release -j$(nproc) + + - uses: autoconf/make + + - uses: autoconf/make-install + + - runs: | + make DESTDIR="$${{targets.destdir}}" install + + - uses: strip + + # Get rid of the bundled npm, we don't need it. + - runs: | + rm -rf "${{targets.destdir}}"/usr/lib/node_modules + rm "${{targets.destdir}}"/usr/bin/npm + rm "${{targets.destdir}}"/usr/bin/npx + +update: + enabled: true + github: + identifier: nodejs/node + strip-prefix: v + use-tag: true + tag-filter: v22. + +test: + pipeline: + - name: Verify Node.js Installation + runs: | + node --version || exit 1 + - name: Execute Basic JavaScript + runs: | + cat <<'EOF' > test.js + console.log('Hello, World!'); + EOF + node test.js | grep 'Hello, World!' || exit 1 + - name: Test International Number Formatting + runs: | + cat <<'EOF' > testIntl.js + console.log(new Intl.NumberFormat('en-EN').format(1234.56)); + console.log(new Intl.NumberFormat('de-DE').format(1234.56)); + EOF + node testIntl.js | grep '1,234.56' && node testIntl.js | grep '1.234,56' || exit 1