nodePackages.node-gyp: local nodejs header files

From within the sandbox, it couldn't be possible to do HTTP requests so we need
to make `node-gyp` aware of local `nodejs` and use header files out of it
instead of attempt to download it and fail.
This commit is contained in:
olebedev 2021-08-10 15:39:02 +10:00 committed by olebedev
parent 2457ddc952
commit 98b9a7fdea
No known key found for this signature in database
GPG key ID: 548A423AE8849EE8

View file

@ -198,6 +198,16 @@ let
'';
};
node-gyp = super.node-gyp.override {
nativeBuildInputs = [ pkgs.makeWrapper ];
# Teach node-gyp to use nodejs headers locally rather that download them form https://nodejs.org.
# This is important when build nodejs packages in sandbox.
postInstall = ''
wrapProgram "$out/bin/node-gyp" \
--set npm_config_nodedir ${nodejs}
'';
};
node-inspector = super.node-inspector.override {
buildInputs = [ self.node-pre-gyp ];
meta.broken = since "10";