nodejs_25: init at 25.2.1 (#452389)

This commit is contained in:
Sandro
2025-12-04 02:29:03 +01:00
committed by GitHub
3 changed files with 70 additions and 2 deletions

View File

@@ -34,6 +34,8 @@
- `corepack_latest` has been removed, as Corepack is no longer distributed with Node.js.
- The `nodejs_latest` alias now points to `nodejs_25` instead of `nodejs_24`.
### Deprecations {#sec-nixpkgs-release-26.05-lib-deprecations}

View File

@@ -0,0 +1,63 @@
{
lib,
stdenv,
buildPackages,
callPackage,
fetchpatch2,
openssl,
python3,
enableNpm ? true,
}:
let
buildNodejs = callPackage ./nodejs.nix {
inherit openssl;
python = python3;
};
gypPatches =
if stdenv.buildPlatform.isDarwin then
[
./gyp-patches-set-fallback-value-for-CLT-darwin.patch
]
else
[ ];
in
buildNodejs {
inherit enableNpm;
version = "25.2.1";
sha256 = "aa7c4ac1076dc299a8949b8d834263659b2408ec0e5bba484673a8ce0766c8b9";
patches =
(
if (stdenv.hostPlatform.emulatorAvailable buildPackages) then
[
./configure-emulator.patch
]
else
[
(fetchpatch2 {
url = "https://raw.githubusercontent.com/buildroot/buildroot/2f0c31bffdb59fb224387e35134a6d5e09a81d57/package/nodejs/nodejs-src/0003-include-obj-name-in-shared-intermediate.patch";
hash = "sha256-3g4aS+NmmUYNOYRNc6UMJKYoaTlpP5Knt9UHegx+o0Y=";
})
]
)
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isFreeBSD) [
# This patch is concerning.
# https://github.com/nodejs/node/issues/54576
# It is only supposed to affect clang >= 17, but I'm seeing it on clang 19.
# I'm keeping the predicate for this patch pretty strict out of caution,
# so if you see the error it's supposed to prevent, feel free to loosen it.
(fetchpatch2 {
url = "https://raw.githubusercontent.com/rubyjs/libv8-node/62476a398d4c9c1a670240a3b070d69544be3761/patch/v8-no-assert-trivially-copyable.patch";
hash = "sha256-hSTLljmVzYmc3WAVeRq9EPYluXGXFeWVXkykufGQPVw=";
})
]
++ [
./configure-armv6-vfpv2.patch
./node-npm-build-npm-package-logic.patch
./use-correct-env-in-tests.patch
./bin-sh-node-run-v22.patch
./use-nix-codesign.patch
]
++ gypPatches;
}

View File

@@ -3218,9 +3218,12 @@ with pkgs;
nodejs-slim_24 = callPackage ../development/web/nodejs/v24.nix { enableNpm = false; };
corepack_24 = callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs_24; };
nodejs_25 = callPackage ../development/web/nodejs/v25.nix { };
nodejs-slim_25 = callPackage ../development/web/nodejs/v25.nix { enableNpm = false; };
# Update this when adding the newest nodejs major version!
nodejs_latest = nodejs_24;
nodejs-slim_latest = nodejs-slim_24;
nodejs_latest = nodejs_25;
nodejs-slim_latest = nodejs-slim_25;
buildNpmPackage = callPackage ../build-support/node/build-npm-package { };