|
54 | 54 | inherit hash; |
55 | 55 | }; |
56 | 56 |
|
57 | | - patches = [ |
58 | | - # Allow building with system v8. |
59 | | - # https://github.com/plv8/plv8/pull/505 (rejected) |
60 | | - ./0001-build-Allow-using-V8-from-system-${version}.patch |
61 | | - ] |
62 | | - ++ lib.optionals (builtins.compareVersions "3.1.10" version >= 0) [ |
63 | | - # Apply https://github.com/plv8/plv8/pull/552/ patch to fix extension upgrade problems |
64 | | - ./0001-fix-upgrade-related-woes-with-GUC-redefinitions-${version}.patch |
65 | | - ]; |
| 57 | + patches = |
| 58 | + [ |
| 59 | + # Allow building with system v8. |
| 60 | + # https://github.com/plv8/plv8/pull/505 (rejected) |
| 61 | + ./0001-build-Allow-using-V8-from-system-${version}.patch |
| 62 | + ] |
| 63 | + ++ lib.optionals (builtins.compareVersions "3.1.10" version >= 0) [ |
| 64 | + # Apply https://github.com/plv8/plv8/pull/552/ patch to fix extension upgrade problems |
| 65 | + ./0001-fix-upgrade-related-woes-with-GUC-redefinitions-${version}.patch |
| 66 | + ]; |
66 | 67 |
|
67 | | - nativeBuildInputs = [ |
68 | | - perl |
69 | | - ] |
70 | | - ++ lib.optionals stdenv.isDarwin [ |
71 | | - clang |
72 | | - xcbuild |
73 | | - ]; |
| 68 | + nativeBuildInputs = |
| 69 | + [ perl ] |
| 70 | + ++ lib.optionals stdenv.isDarwin [ |
| 71 | + clang |
| 72 | + xcbuild |
| 73 | + ]; |
74 | 74 |
|
75 | 75 | buildInputs = [ |
76 | 76 | (if (builtins.compareVersions "3.1.10" version >= 0) then v8 else nodejs_20.libv8) |
|
79 | 79 |
|
80 | 80 | buildFlags = [ "all" ]; |
81 | 81 |
|
82 | | - makeFlags = [ |
83 | | - # Nixpkgs build a v8 monolith instead of separate v8_libplatform. |
84 | | - "USE_SYSTEM_V8=1" |
85 | | - "V8_OUTDIR=${v8}/lib" |
86 | | - "PG_CONFIG=${postgresql}/bin/pg_config" |
87 | | - ] |
88 | | - ++ lib.optionals stdenv.isDarwin [ |
89 | | - "CC=${clang}/bin/clang" |
90 | | - "CXX=${clang}/bin/clang++" |
91 | | - "SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib -Wl,-headerpad_max_install_names" |
92 | | - ] |
93 | | - ++ lib.optionals (!stdenv.isDarwin) [ "SHLIB_LINK=-lv8" ]; |
| 82 | + makeFlags = |
| 83 | + [ |
| 84 | + # Nixpkgs build a v8 monolith instead of separate v8_libplatform. |
| 85 | + "USE_SYSTEM_V8=1" |
| 86 | + "V8_OUTDIR=${v8}/lib" |
| 87 | + "PG_CONFIG=${postgresql}/bin/pg_config" |
| 88 | + ] |
| 89 | + ++ lib.optionals stdenv.isDarwin [ |
| 90 | + "CC=${clang}/bin/clang" |
| 91 | + "CXX=${clang}/bin/clang++" |
| 92 | + "SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib -Wl,-headerpad_max_install_names" |
| 93 | + ] |
| 94 | + ++ lib.optionals (!stdenv.isDarwin) [ "SHLIB_LINK=-lv8" ]; |
94 | 95 |
|
95 | 96 | NIX_LDFLAGS = lib.optionals stdenv.isDarwin [ |
96 | 97 | "-L${postgresql}/lib" |
|
141 | 142 | install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/$LIB_NAME |
142 | 143 | ''} |
143 | 144 |
|
144 | | - ${lib.optionalString (!stdenv.isDarwin) '' |
145 | | - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME |
146 | | - ''} |
| 145 | + ${ |
| 146 | + lib.optionalString (!stdenv.isDarwin) '' |
| 147 | + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME |
| 148 | + '' |
| 149 | + } |
147 | 150 | else |
148 | 151 | ${lib.optionalString stdenv.isDarwin '' |
149 | 152 | install_name_tool -add_rpath "${v8}/lib" $out/lib/$LIB_NAME |
|
152 | 155 | install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/$LIB_NAME |
153 | 156 | ''} |
154 | 157 |
|
155 | | - ${lib.optionalString (!stdenv.isDarwin) '' |
156 | | - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME |
157 | | - ''} |
| 158 | + ${ |
| 159 | + lib.optionalString (!stdenv.isDarwin) '' |
| 160 | + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME |
| 161 | + '' |
| 162 | + } |
158 | 163 | fi |
159 | 164 |
|
160 | 165 | # plv8 3.2.x removed support for coffeejs and livescript |
|
0 commit comments