4747
4848 needsRustCompiler = withTemporal && ! builtins . hasAttr "temporal_capi" sharedLibDeps ;
4949
50- buildInputs = builtins . attrValues sharedLibDeps ++ pkgs . lib . optional useSharedICU icu ;
50+ nativeBuildInputs =
51+ pkgs . nodejs-slim_latest . nativeBuildInputs
52+ ++ pkgs . lib . optionals needsRustCompiler [
53+ pkgs . cargo
54+ pkgs . rustc
55+ ] ;
56+ buildInputs = pkgs . lib . optional useSharedICU icu ;
57+
58+ # Put here only the configure flags that affect the V8 build
5159 configureFlags = [
5260 (
5361 if icu == null then
5765 )
5866 ]
5967 ++ extraConfigFlags
60- ++ pkgs . lib . optional ( ! withAmaro ) "--without-amaro"
61- ++ pkgs . lib . optional ( ! withLief ) "--without-lief"
62- ++ pkgs . lib . optional withQuic "--experimental-quic"
63- ++ pkgs . lib . optional ( ! withSQLite ) "--without-sqlite"
64- ++ pkgs . lib . optional ( ! withSSL ) "--without-ssl"
6568 ++ pkgs . lib . optional withTemporal "--v8-enable-temporal-support"
66- ++ pkgs . lib . optional ( ninja != null ) "--ninja"
67- ++ pkgs . lib . optional loadJSBuiltinsDynamically "--node-builtin-modules-path=${ builtins . toString ./. } "
6869 ++ pkgs . lib . concatMap ( name : [
6970 "--shared-${ name } "
70- "--shared-${ name } -libpath=${ pkgs . lib . getLib sharedLibDeps . ${ name } } /lib"
71- "--shared-${ name } -include=${ pkgs . lib . getInclude sharedLibDeps . ${ name } } /include"
7271 ] ) ( builtins . attrNames sharedLibDeps ) ;
7372in
7473pkgs . mkShell {
75- inherit ( pkgs . nodejs-slim_latest ) nativeBuildInputs ;
74+ inherit nativeBuildInputs ;
7675
7776 buildInputs =
78- buildInputs
77+ builtins . attrValues sharedLibDeps
78+ ++ buildInputs
7979 ++ pkgs . lib . optional ( useSeparateDerivationForV8 != false ) (
8080 if useSeparateDerivationForV8 == true then
81- import ./tools/nix/v8.nix {
81+ pkgs . callPackage ./tools/nix/v8.nix {
8282 inherit
83- pkgs
8483 configureFlags
8584 buildInputs
86- needsRustCompiler
85+ nativeBuildInputs
8786 ;
8887 }
8988 else
9089 useSeparateDerivationForV8
9190 ) ;
9291
93- packages =
94- pkgs . lib . optional ( ccache != null ) ccache
95- ++ devTools
96- ++ benchmarkTools
97- ++ pkgs . lib . optionals needsRustCompiler [
98- pkgs . cargo
99- pkgs . rustc
100- ] ;
92+ packages = devTools ++ benchmarkTools ++ pkgs . lib . optional ( ccache != null ) ccache ;
10193
10294 shellHook = pkgs . lib . optionalString ( ccache != null ) ''
10395 export CC="${ pkgs . lib . getExe ccache } $CC"
@@ -118,7 +110,15 @@ pkgs.mkShell {
118110 ]
119111 ) ;
120112 CONFIG_FLAGS = builtins . toString (
121- configureFlags ++ pkgs . lib . optional ( useSeparateDerivationForV8 != false ) "--without-bundled-v8"
113+ configureFlags
114+ ++ pkgs . lib . optional ( ninja != null ) "--ninja"
115+ ++ pkgs . lib . optional ( ! withAmaro ) "--without-amaro"
116+ ++ pkgs . lib . optional ( ! withLief ) "--without-lief"
117+ ++ pkgs . lib . optional withQuic "--experimental-quic"
118+ ++ pkgs . lib . optional ( ! withSQLite ) "--without-sqlite"
119+ ++ pkgs . lib . optional ( ! withSSL ) "--without-ssl"
120+ ++ pkgs . lib . optional loadJSBuiltinsDynamically "--node-builtin-modules-path=${ builtins . toString ./. } "
121+ ++ pkgs . lib . optional ( useSeparateDerivationForV8 != false ) "--without-bundled-v8"
122122 ) ;
123123 NOSQLITE = pkgs . lib . optionalString ( ! withSQLite ) "1" ;
124124}
0 commit comments