8888 ]
8989 ++ builtins . map ( depName : "--shared-${ depName } " ) sharedV8Deps
9090 ++ pkgs . lib . optional withPerfetto "--with-perfetto" ;
91+
92+ v8Derivation =
93+ if useSeparateDerivationForV8 == true then
94+ let
95+ sharedLibsToMock = pkgs . callPackage ./tools/nix/non-v8-deps-mock.nix { } ;
96+ in
97+ pkgs . callPackage ./tools/nix/v8.nix {
98+ inherit nativeBuildInputs icu ;
99+
100+ configureFlags = configureFlags ++ sharedLibsToMock . configureFlags ++ [ "--ninja" ] ;
101+ buildInputs = buildInputs ++ [ sharedLibsToMock ] ;
102+ }
103+ else
104+ useSeparateDerivationForV8 ;
91105in
92106pkgs . mkShell {
93107 inherit nativeBuildInputs ;
@@ -98,20 +112,7 @@ pkgs.mkShell {
98112 buildInputs =
99113 builtins . attrValues sharedLibDeps
100114 ++ buildInputs
101- ++ pkgs . lib . optional ( useSeparateDerivationForV8 != false ) (
102- if useSeparateDerivationForV8 == true then
103- let
104- sharedLibsToMock = pkgs . callPackage ./tools/nix/non-v8-deps-mock.nix { } ;
105- in
106- pkgs . callPackage ./tools/nix/v8.nix {
107- inherit nativeBuildInputs icu ;
108-
109- configureFlags = configureFlags ++ sharedLibsToMock . configureFlags ++ [ "--ninja" ] ;
110- buildInputs = buildInputs ++ [ sharedLibsToMock ] ;
111- }
112- else
113- useSeparateDerivationForV8
114- ) ;
115+ ++ pkgs . lib . optional ( useSeparateDerivationForV8 != false ) v8Derivation ;
115116
116117 packages = devTools ++ benchmarkTools ++ pkgs . lib . optional ( ccache != null ) ccache ;
117118
@@ -120,6 +121,10 @@ pkgs.mkShell {
120121 export CXX="${ pkgs . lib . getExe ccache } $CXX"
121122 '' ;
122123
124+ passthru = {
125+ inherit v8Derivation ;
126+ } ;
127+
123128 env = {
124129 BUILD_WITH = if ( ninja != null ) then "ninja" else "make" ;
125130 NINJA = pkgs . lib . optionalString ( ninja != null ) "${ pkgs . lib . getExe ninja } " ;
0 commit comments