nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 callPackage,
5 fetchpatch2,
6 openssl,
7 python3,
8 enableNpm ? true,
9}:
10
11let
12 buildNodejs = callPackage ./nodejs.nix {
13 inherit openssl;
14 python = python3;
15 };
16
17 gypPatches = callPackage ./gyp-patches.nix { } ++ [
18 # Fixes builds with Nix sandbox on Darwin for gyp.
19 # See https://github.com/NixOS/nixpkgs/issues/261820
20 # and https://github.com/nodejs/gyp-next/pull/216
21 (fetchpatch2 {
22 url = "https://github.com/nodejs/gyp-next/commit/706d04aba5bd18f311dc56f84720e99f64c73466.patch?full_index=1";
23 hash = "sha256-iV9qvj0meZkgRzFNur2v1jtLZahbqvSJ237NoM8pPZc=";
24 stripLen = 1;
25 extraPrefix = "tools/gyp/";
26 })
27 (fetchpatch2 {
28 url = "https://github.com/nodejs/gyp-next/commit/706d04aba5bd18f311dc56f84720e99f64c73466.patch?full_index=1";
29 hash = "sha256-1iyeeAprmWpmLafvOOXW45iZ4jWFSloWJxQ0reAKBOo=";
30 stripLen = 1;
31 extraPrefix = "deps/npm/node_modules/node-gyp/gyp/";
32 })
33
34 ./gyp-patches-pre-v22-import-sys.patch
35 ];
36in
37buildNodejs {
38 inherit enableNpm;
39 version = "20.20.0";
40 sha256 = "5294d9d2915620e819e6892fd7e545b98d650bad36dae54e6527eaac482add98";
41 patches = [
42 ./configure-emulator.patch
43 ./configure-armv6-vfpv2.patch
44 ./node-npm-build-npm-package-logic.patch
45 ./use-correct-env-in-tests.patch
46 ./use-nix-codesign.patch
47
48 # TODO: remove when included in a release
49 (fetchpatch2 {
50 url = "https://github.com/nodejs/node/commit/8caa1dcee63b2c6fd7a9edf9b9a6222b38a2cf62.patch?full_index=1";
51 hash = "sha256-DtN0bpYfo5twHz2GrLLgq4Bu2gFYTkNPMRKhrgeYRyA=";
52 includes = [ "test/parallel/test-setproctitle.js" ];
53 })
54 (fetchpatch2 {
55 url = "https://github.com/nodejs/node/commit/499a5c345165f0d4a94b98d08f1ace7268781564.patch?full_index=1";
56 hash = "sha256-wF4+CytC1OB5egJGOfLm1USsYY12f9kADymVrxotezE=";
57 })
58 ]
59 ++ lib.optionals (!stdenv.hostPlatform.isStatic) [
60 # Fix builds with shared llhttp
61 (fetchpatch2 {
62 url = "https://github.com/nodejs/node/commit/ff3a028f8bf88da70dc79e1d7b7947a8d5a8548a.patch?full_index=1";
63 hash = "sha256-LJcO3RXVPnpbeuD87fiJ260m3BQXNk3+vvZkBMFUz5w=";
64 })
65 # update tests for nghttp2 1.65
66 ./deprecate-http2-priority-signaling.patch
67 (fetchpatch2 {
68 url = "https://github.com/nodejs/node/commit/a63126409ad4334dd5d838c39806f38c020748b9.diff?full_index=1";
69 hash = "sha256-lfq8PMNvrfJjlp0oE3rJkIsihln/Gcs1T/qgI3wW2kQ=";
70 includes = [ "test/*" ];
71 })
72 ]
73 ++ gypPatches;
74}