Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions pkgs/development/web/nodejs/gyp-patches.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
{ fetchpatch2 }:
{
lib,
fetchpatch2,
patch_npm ? true,
patch_tools ? true,
}:
let
name = "gyp-darwin-sandbox.patch";
url = "https://github.com/nodejs/gyp-next/commit/706d04aba5bd18f311dc56f84720e99f64c73466.patch";
url = "https://github.com/nodejs/gyp-next/commit/706d04aba5bd18f311dc56f84720e99f64c73466.patch?full_index=1";
in
[
lib.optionals patch_tools ([
# Fixes builds with Nix sandbox on Darwin for gyp.
# See https://github.com/NixOS/nixpkgs/issues/261820
# and https://github.com/nodejs/gyp-next/pull/216
(fetchpatch2 {
inherit name url;
hash = "sha256-l8FzgLq9CbVJCkXfnTyDQ+vXKCz65wpaffE74oSU+kY=";
inherit url;
hash = "sha256-iV9qvj0meZkgRzFNur2v1jtLZahbqvSJ237NoM8pPZc=";
stripLen = 1;
extraPrefix = "tools/gyp/";
})
])
++ lib.optionals patch_npm ([
(fetchpatch2 {
inherit name url;
hash = "sha256-UVUn4onXfJgFoAdApLAbliiBgM9rxDdIo53WjFryoBI=";
inherit url;
hash = "sha256-1iyeeAprmWpmLafvOOXW45iZ4jWFSloWJxQ0reAKBOo=";
stripLen = 1;
extraPrefix = "deps/npm/node_modules/node-gyp/gyp/";
})
]
])
15 changes: 5 additions & 10 deletions pkgs/development/web/nodejs/v22.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ let
inherit openssl;
python = python3;
};

gypPatches = callPackage ./gyp-patches.nix {
patch_tools = false;
};
in
buildNodejs {
inherit enableNpm;
Expand Down Expand Up @@ -44,6 +48,7 @@ buildNodejs {
hash = "sha256-hSTLljmVzYmc3WAVeRq9EPYluXGXFeWVXkykufGQPVw=";
})
]
++ gypPatches
++ [
./configure-armv6-vfpv2.patch
./disable-darwin-v8-system-instrumentation-node19.patch
Expand All @@ -58,15 +63,5 @@ buildNodejs {
hash = "sha256-k3h8mPgvaIYGAkGmaL+ix7kUnyLw4/PF7wXMAWrPMXo=";
revert = true;
})
# Fixes builds with Nix sandbox on Darwin for gyp.
# See https://github.com/NixOS/nixpkgs/issues/261820
# and https://github.com/nodejs/gyp-next/pull/216
(fetchpatch2 {
name = "gyp-darwin-sandbox.patch";
url = "https://github.com/nodejs/gyp-next/commit/706d04aba5bd18f311dc56f84720e99f64c73466.patch?full_index=1";
hash = "sha256-1iyeeAprmWpmLafvOOXW45iZ4jWFSloWJxQ0reAKBOo=";
stripLen = 1;
extraPrefix = "deps/npm/node_modules/node-gyp/gyp/";
})
];
}
Loading