88
99let
1010 nodejs = pkgs . nodejs-slim_latest ;
11+ v8Dir = ../../deps/v8 ;
1112
1213 version =
1314 let
1617 + "#define V8_MINOR_VERSION ([0-9]+).*"
1718 + "#define V8_BUILD_NUMBER ([0-9]+).*"
1819 + "#define V8_PATCH_LEVEL ([0-9]+).*"
19- ) ( builtins . readFile ../../deps/v8/ include/v8-version.h) ;
20+ ) ( builtins . readFile " ${ v8Dir } / include/v8-version.h" ) ;
2021 v8_embedder_string = builtins . match ".*'v8_embedder_string': '-(node.[0-9]+)'.*" (
2122 builtins . readFile ../../common.gypi
2223 ) ;
@@ -41,7 +42,7 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
4142 ../../configure.py
4243 ../../deps/inspector_protocol/inspector_protocol.gyp
4344 ../../deps/ncrypto/ncrypto.gyp
44- ../../deps/v8
45+ v8Dir
4546 ../../node.gyp
4647 ../../node.gypi
4748 ../../src/inspector/node_inspector.gypi
@@ -89,7 +90,7 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
8990 '' ;
9091 installPhase = ''
9192 ${
92- if pkgs . stdenv . buildPlatform . isDarwin then
93+ if pkgs . stdenv . hostPlatform . isDarwin then
9394 # Darwin is excluded from creating thin archive in tools/gyp/pylib/gyp/generator/ninja.py:2488
9495 "install -Dm644 out/Release/lib* -t $out/lib"
9596 else
@@ -109,22 +110,17 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
109110 done
110111 ''
111112 }
112- libs=$(for f in $out/lib/lib*.a; do
113- b=$(basename "$f" .a)
114- printf " -l%s" "'' ${b#lib}"
115- done)
116-
117- # copy v8 headers
118- cp -r deps/v8/include $out/
119113
120- # create a pkgconfig file for v8
121114 mkdir -p $out/lib/pkgconfig
122115 cat -> $out/lib/pkgconfig/v8.pc << EOF
123116 Name: v8
124117 Description: V8 JavaScript Engine build for Node.js CI
125118 Version: ${ version }
126- Libs: -L$out/lib $libs
127- Cflags: -I$out/include
119+ Libs: -L$out/lib $(for f in $out/lib/lib*.a; do
120+ b=$(basename "$f" .a)
121+ printf " -l%s" "'' ${b#lib}"
122+ done)
123+ Cflags: -I${ v8Dir } /include -I${ v8Dir } /third_party/abseil-cpp -I${ v8Dir } /third_party/simdutf
128124 EOF
129125 '' ;
130126} )
0 commit comments