1{
2 callPackage,
3 fetchpatch2,
4 openssl,
5 python3,
6 enableNpm ? true,
7}:
8
9let
10 buildNodejs = callPackage ./nodejs.nix {
11 inherit openssl;
12 python = python3;
13 };
14
15 gypPatches = callPackage ./gyp-patches.nix { } ++ [
16 ./gyp-patches-pre-v22-import-sys.patch
17 ];
18in
19buildNodejs {
20 inherit enableNpm;
21 version = "20.19.2";
22 sha256 = "4a7ff611d5180f4e420204fa6f22f9f9deb2ac5e98619dd9a4de87edf5b03b6e";
23 patches = [
24 ./configure-emulator.patch
25 ./configure-armv6-vfpv2.patch
26 ./disable-darwin-v8-system-instrumentation-node19.patch
27 ./bypass-darwin-xcrun-node16.patch
28 ./node-npm-build-npm-package-logic.patch
29 ./use-correct-env-in-tests.patch
30
31 # Remove unused `fdopen` in vendored zlib, which causes compilation failures with clang 18 on Darwin.
32 (fetchpatch2 {
33 url = "https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9.patch?full_index=1";
34 extraPrefix = "deps/v8/third_party/zlib/";
35 stripLen = 1;
36 hash = "sha256-WVxsoEcJu0WBTyelNrVQFTZxJhnekQb1GrueeRBRdnY=";
37 })
38 # Backport V8 fixes for LLVM 19.
39 (fetchpatch2 {
40 url = "https://chromium.googlesource.com/v8/v8/+/182d9c05e78b1ddb1cb8242cd3628a7855a0336f%5E%21/?format=TEXT";
41 decode = "base64 -d";
42 extraPrefix = "deps/v8/";
43 stripLen = 1;
44 hash = "sha256-bDTwFbATPn5W4VifWz/SqaiigXYDWHq785C64VezuUE=";
45 })
46 (fetchpatch2 {
47 url = "https://chromium.googlesource.com/v8/v8/+/1a3ecc2483b2dba6ab9f7e9f8f4b60dbfef504b7%5E%21/?format=TEXT";
48 decode = "base64 -d";
49 extraPrefix = "deps/v8/";
50 stripLen = 1;
51 hash = "sha256-6y3aEqxNC4iTQEv1oewodJrhOHxjp5xZMq1P1QL94Rg=";
52 })
53 # fix test failure on macos 15.4
54 (fetchpatch2 {
55 url = "https://github.com/nodejs/node/commit/33f6e1ea296cd20366ab94e666b03899a081af94.patch?full_index=1";
56 hash = "sha256-aVBMcQlhQeviUQpMIfC988jjDB2BgYzlMYsq+w16mzU=";
57 })
58 ] ++ gypPatches;
59}