2
2
stdenv ,
3
3
lib ,
4
4
fetchFromGitHub ,
5
- v8 ,
5
+ nodejs ,
6
6
perl ,
7
7
postgresql ,
8
8
# For passthru test on various systems, and local development on macos
9
9
# not we are not currently using passthru tests but retaining for possible contrib
10
- # to nixpkgs
10
+ # to nixpkgs
11
11
clang ,
12
12
xcbuild ,
13
13
darwin ,
@@ -40,7 +40,7 @@ stdenv.mkDerivation (finalAttrs: {
40
40
41
41
buildInputs =
42
42
[
43
- v8
43
+ nodejs . libv8
44
44
postgresql
45
45
]
46
46
++ lib . optionals stdenv . isDarwin [
@@ -54,20 +54,20 @@ stdenv.mkDerivation (finalAttrs: {
54
54
[
55
55
# Nixpkgs build a v8 monolith instead of separate v8_libplatform.
56
56
"USE_SYSTEM_V8=1"
57
- "V8_OUTDIR=${ v8 } /lib"
57
+ "V8_OUTDIR=${ nodejs . libv8 } /lib"
58
58
"PG_CONFIG=${ postgresql } /bin/pg_config"
59
59
]
60
60
++ lib . optionals stdenv . isDarwin [
61
61
"CC=${ clang } /bin/clang"
62
62
"CXX=${ clang } /bin/clang++"
63
- "SHLIB_LINK=-L${ v8 } /lib -lv8_monolith -Wl,-rpath,${ v8 } /lib"
63
+ "SHLIB_LINK=-L${ nodejs . libv8 } /lib -lv8_monolith -Wl,-rpath,${ nodejs . libv8 } /lib"
64
64
]
65
65
++ lib . optionals ( ! stdenv . isDarwin ) [ "SHLIB_LINK=-lv8" ] ;
66
66
67
67
NIX_LDFLAGS = (
68
68
lib . optionals stdenv . isDarwin [
69
69
"-L${ postgresql } /lib"
70
- "-L${ v8 } /lib"
70
+ "-L${ nodejs . libv8 } /lib"
71
71
"-lv8_monolith"
72
72
"-lpq"
73
73
"-lpgcommon"
@@ -119,30 +119,26 @@ stdenv.mkDerivation (finalAttrs: {
119
119
sed -i 's|module_pathname = '"'"'$libdir/plv8-[0-9.]*'"'"'|module_pathname = '"'"'$libdir/plv8'"'"'|' "$out/share/postgresql/extension/plls.control"
120
120
121
121
${ lib . optionalString stdenv . isDarwin ''
122
- install_name_tool -add_rpath "${ v8 } /lib" $out/lib/plv8.so
122
+ install_name_tool -add_rpath "${ nodejs . libv8 } /lib" $out/lib/plv8.so
123
123
install_name_tool -add_rpath "${ postgresql } /lib" $out/lib/plv8.so
124
124
install_name_tool -add_rpath "${ stdenv . cc . cc . lib } /lib" $out/lib/plv8.so
125
- install_name_tool -change @rpath/libv8_monolith.dylib ${ v8 } /lib/libv8_monolith.dylib $out/lib/plv8.so
125
+ install_name_tool -change @rpath/libv8_monolith.dylib ${ nodejs . libv8 } /lib/libv8_monolith.dylib $out/lib/plv8.so
126
126
'' }
127
127
128
- ${
129
- lib . optionalString ( ! stdenv . isDarwin ) ''
130
- ${ patchelf } /bin/patchelf --set-rpath "${ v8 } /lib:${ postgresql } /lib:${ stdenv . cc . cc . lib } /lib" $out/lib/plv8.so
131
- ''
132
- }
128
+ ${ lib . optionalString ( ! stdenv . isDarwin ) ''
129
+ ${ patchelf } /bin/patchelf --set-rpath "${ nodejs . libv8 } /lib:${ postgresql } /lib:${ stdenv . cc . cc . lib } /lib" $out/lib/plv8.so
130
+ '' }
133
131
else
134
132
${ lib . optionalString stdenv . isDarwin ''
135
- install_name_tool -add_rpath "${ v8 } /lib" $out/lib/plv8-${ finalAttrs . version } ${ postgresql . dlSuffix }
133
+ install_name_tool -add_rpath "${ nodejs . libv8 } /lib" $out/lib/plv8-${ finalAttrs . version } ${ postgresql . dlSuffix }
136
134
install_name_tool -add_rpath "${ postgresql } /lib" $out/lib/plv8-${ finalAttrs . version } ${ postgresql . dlSuffix }
137
135
install_name_tool -add_rpath "${ stdenv . cc . cc . lib } /lib" $out/lib/plv8-${ finalAttrs . version } ${ postgresql . dlSuffix }
138
- install_name_tool -change @rpath/libv8_monolith.dylib ${ v8 } /lib/libv8_monolith.dylib $out/lib/plv8-${ finalAttrs . version } ${ postgresql . dlSuffix }
136
+ install_name_tool -change @rpath/libv8_monolith.dylib ${ nodejs . libv8 } /lib/libv8_monolith.dylib $out/lib/plv8-${ finalAttrs . version } ${ postgresql . dlSuffix }
139
137
'' }
140
138
141
- ${
142
- lib . optionalString ( ! stdenv . isDarwin ) ''
143
- ${ patchelf } /bin/patchelf --set-rpath "${ v8 } /lib:${ postgresql } /lib:${ stdenv . cc . cc . lib } /lib" $out/lib/plv8-${ finalAttrs . version } ${ postgresql . dlSuffix }
144
- ''
145
- }
139
+ ${ lib . optionalString ( ! stdenv . isDarwin ) ''
140
+ ${ patchelf } /bin/patchelf --set-rpath "${ nodejs . libv8 } /lib:${ postgresql } /lib:${ stdenv . cc . cc . lib } /lib" $out/lib/plv8-${ finalAttrs . version } ${ postgresql . dlSuffix }
141
+ '' }
146
142
fi
147
143
'' ;
148
144
0 commit comments