mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
tools: extract Nix dependency lists to separate files
This should improve the readability, as well as the UX of cherry-picking what dependency the user wants in their env. PR-URL: https://github.com/nodejs/node/pull/60495 Reviewed-By: Jacob Smith <jacob@frende.me>
This commit is contained in:
parent
8e5c80d108
commit
c94047dfda
@ -299,7 +299,7 @@ that flag to use all the shared dependencies, or specify only some dependencies:
|
||||
```bash
|
||||
cat -> .envrc <<'EOF'
|
||||
use nix --arg sharedLibDeps '{
|
||||
inherit (import <nixpkgs> {})
|
||||
inherit (import ./tools/nix/sharedLibDeps.nix {})
|
||||
openssl
|
||||
zlib
|
||||
;
|
||||
|
||||
63
shell.nix
63
shell.nix
@ -1,68 +1,13 @@
|
||||
{
|
||||
pkgs ? import "${./tools/nix/pkgs.nix}" { },
|
||||
pkgs ? import ./tools/nix/pkgs.nix { },
|
||||
loadJSBuiltinsDynamically ? true, # Load `lib/**.js` from disk instead of embedding
|
||||
ncu-path ? null, # Provide this if you want to use a local version of NCU
|
||||
icu ? pkgs.icu,
|
||||
sharedLibDeps ? {
|
||||
inherit (pkgs)
|
||||
ada
|
||||
brotli
|
||||
c-ares
|
||||
libuv
|
||||
nghttp2
|
||||
nghttp3
|
||||
ngtcp2
|
||||
simdjson
|
||||
simdutf
|
||||
sqlite
|
||||
uvwasi
|
||||
zlib
|
||||
zstd
|
||||
;
|
||||
http-parser = pkgs.llhttp;
|
||||
openssl = pkgs.openssl.overrideAttrs (old: {
|
||||
version = "3.5.4";
|
||||
src = pkgs.fetchurl {
|
||||
url = builtins.replaceStrings [ old.version ] [ "3.5.4" ] old.src.url;
|
||||
hash = "sha256-lnMR+ElVMWlpvbHY1LmDcY70IzhjnGIexMNP3e81Xpk=";
|
||||
};
|
||||
doCheck = false;
|
||||
configureFlags = (old.configureFlags or [ ]) ++ [
|
||||
"no-docs"
|
||||
"no-tests"
|
||||
];
|
||||
outputs = [
|
||||
"bin"
|
||||
"out"
|
||||
"dev"
|
||||
];
|
||||
});
|
||||
},
|
||||
sharedLibDeps ? import ./tools/nix/sharedLibDeps.nix { inherit pkgs; },
|
||||
ccache ? pkgs.ccache,
|
||||
ninja ? pkgs.ninja,
|
||||
devTools ? [
|
||||
pkgs.curl
|
||||
pkgs.gh
|
||||
pkgs.git
|
||||
pkgs.jq
|
||||
pkgs.shellcheck
|
||||
]
|
||||
++ (
|
||||
if (ncu-path == null) then
|
||||
[ pkgs.node-core-utils ]
|
||||
else
|
||||
[
|
||||
(pkgs.writeShellScriptBin "git-node" "exec \"${ncu-path}/bin/git-node.js\" \"$@\"")
|
||||
(pkgs.writeShellScriptBin "ncu-ci" "exec \"${ncu-path}/bin/ncu-ci.js\" \"$@\"")
|
||||
(pkgs.writeShellScriptBin "ncu-config" "exec \"${ncu-path}/bin/ncu-config.js\" \"$@\"")
|
||||
]
|
||||
),
|
||||
benchmarkTools ? [
|
||||
pkgs.R
|
||||
pkgs.rPackages.ggplot2
|
||||
pkgs.rPackages.plyr
|
||||
pkgs.wrk
|
||||
],
|
||||
devTools ? import ./tools/nix/devTools.nix { inherit pkgs ncu-path; },
|
||||
benchmarkTools ? import ./tools/nix/benchmarkTools.nix { inherit pkgs; },
|
||||
extraConfigFlags ? [
|
||||
"--without-npm"
|
||||
"--debug-node"
|
||||
|
||||
9
tools/nix/benchmarkTools.nix
Normal file
9
tools/nix/benchmarkTools.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
pkgs ? import ./pkgs.nix { },
|
||||
}:
|
||||
[
|
||||
pkgs.R
|
||||
pkgs.rPackages.ggplot2
|
||||
pkgs.rPackages.plyr
|
||||
pkgs.wrk
|
||||
]
|
||||
21
tools/nix/devTools.nix
Normal file
21
tools/nix/devTools.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
pkgs ? import ./pkgs.nix { },
|
||||
ncu-path ? null, # Provide this if you want to use a local version of NCU
|
||||
}:
|
||||
[
|
||||
pkgs.curl
|
||||
pkgs.gh
|
||||
pkgs.git
|
||||
pkgs.jq
|
||||
pkgs.shellcheck
|
||||
]
|
||||
++ (
|
||||
if (ncu-path == null) then
|
||||
[ pkgs.node-core-utils ]
|
||||
else
|
||||
[
|
||||
(pkgs.writeShellScriptBin "git-node" "exec \"${ncu-path}/bin/git-node.js\" \"$@\"")
|
||||
(pkgs.writeShellScriptBin "ncu-ci" "exec \"${ncu-path}/bin/ncu-ci.js\" \"$@\"")
|
||||
(pkgs.writeShellScriptBin "ncu-config" "exec \"${ncu-path}/bin/ncu-config.js\" \"$@\"")
|
||||
]
|
||||
)
|
||||
38
tools/nix/sharedLibDeps.nix
Normal file
38
tools/nix/sharedLibDeps.nix
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
pkgs ? import ./pkgs.nix { },
|
||||
}:
|
||||
{
|
||||
inherit (pkgs)
|
||||
ada
|
||||
brotli
|
||||
c-ares
|
||||
libuv
|
||||
nghttp2
|
||||
nghttp3
|
||||
ngtcp2
|
||||
simdjson
|
||||
simdutf
|
||||
sqlite
|
||||
uvwasi
|
||||
zlib
|
||||
zstd
|
||||
;
|
||||
http-parser = pkgs.llhttp;
|
||||
openssl = pkgs.openssl.overrideAttrs (old: {
|
||||
version = "3.5.4";
|
||||
src = pkgs.fetchurl {
|
||||
url = builtins.replaceStrings [ old.version ] [ "3.5.4" ] old.src.url;
|
||||
hash = "sha256-lnMR+ElVMWlpvbHY1LmDcY70IzhjnGIexMNP3e81Xpk=";
|
||||
};
|
||||
doCheck = false;
|
||||
configureFlags = (old.configureFlags or [ ]) ++ [
|
||||
"no-docs"
|
||||
"no-tests"
|
||||
];
|
||||
outputs = [
|
||||
"bin"
|
||||
"out"
|
||||
"dev"
|
||||
];
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user