|
59 | 59 | inherit hash; |
60 | 60 | }; |
61 | 61 |
|
62 | | - patches = |
63 | | - [ |
64 | | - # Allow building with system v8. |
65 | | - # https://github.com/plv8/plv8/pull/505 (rejected) |
66 | | - ./0001-build-Allow-using-V8-from-system-${version}.patch |
67 | | - ] |
68 | | - ++ lib.optionals (builtins.compareVersions "3.1.10" version >= 0) [ |
69 | | - # Apply https://github.com/plv8/plv8/pull/552/ patch to fix extension upgrade problems |
70 | | - ./0001-fix-upgrade-related-woes-with-GUC-redefinitions-${version}.patch |
71 | | - ]; |
| 62 | + patches = [ |
| 63 | + # Allow building with system v8. |
| 64 | + # https://github.com/plv8/plv8/pull/505 (rejected) |
| 65 | + ./0001-build-Allow-using-V8-from-system-${version}.patch |
| 66 | + ] |
| 67 | + ++ lib.optionals (builtins.compareVersions "3.1.10" version >= 0) [ |
| 68 | + # Apply https://github.com/plv8/plv8/pull/552/ patch to fix extension upgrade problems |
| 69 | + ./0001-fix-upgrade-related-woes-with-GUC-redefinitions-${version}.patch |
| 70 | + ]; |
72 | 71 |
|
73 | | - nativeBuildInputs = |
74 | | - [ perl ] |
75 | | - ++ lib.optionals stdenv.isDarwin [ |
76 | | - clang |
77 | | - xcbuild |
78 | | - ]; |
| 72 | + nativeBuildInputs = [ |
| 73 | + perl |
| 74 | + ] |
| 75 | + ++ lib.optionals stdenv.isDarwin [ |
| 76 | + clang |
| 77 | + xcbuild |
| 78 | + ]; |
79 | 79 |
|
80 | | - buildInputs = |
81 | | - [ |
82 | | - (if (builtins.compareVersions "3.1.10" version >= 0) then v8 else nodejs_20.libv8) |
83 | | - postgresql |
84 | | - ] |
85 | | - ++ lib.optionals stdenv.isDarwin [ |
86 | | - darwin.apple_sdk.frameworks.CoreFoundation |
87 | | - darwin.apple_sdk.frameworks.Kerberos |
88 | | - ]; |
| 80 | + buildInputs = [ |
| 81 | + (if (builtins.compareVersions "3.1.10" version >= 0) then v8 else nodejs_20.libv8) |
| 82 | + postgresql |
| 83 | + ] |
| 84 | + ++ lib.optionals stdenv.isDarwin [ |
| 85 | + darwin.apple_sdk.frameworks.CoreFoundation |
| 86 | + darwin.apple_sdk.frameworks.Kerberos |
| 87 | + ]; |
89 | 88 |
|
90 | 89 | buildFlags = [ "all" ]; |
91 | 90 |
|
92 | | - makeFlags = |
93 | | - [ |
94 | | - # Nixpkgs build a v8 monolith instead of separate v8_libplatform. |
95 | | - "USE_SYSTEM_V8=1" |
96 | | - "V8_OUTDIR=${v8}/lib" |
97 | | - "PG_CONFIG=${postgresql}/bin/pg_config" |
98 | | - ] |
99 | | - ++ lib.optionals stdenv.isDarwin [ |
100 | | - "CC=${clang}/bin/clang" |
101 | | - "CXX=${clang}/bin/clang++" |
102 | | - "SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib" |
103 | | - ] |
104 | | - ++ lib.optionals (!stdenv.isDarwin) [ "SHLIB_LINK=-lv8" ]; |
| 91 | + makeFlags = [ |
| 92 | + # Nixpkgs build a v8 monolith instead of separate v8_libplatform. |
| 93 | + "USE_SYSTEM_V8=1" |
| 94 | + "V8_OUTDIR=${v8}/lib" |
| 95 | + "PG_CONFIG=${postgresql}/bin/pg_config" |
| 96 | + ] |
| 97 | + ++ lib.optionals stdenv.isDarwin [ |
| 98 | + "CC=${clang}/bin/clang" |
| 99 | + "CXX=${clang}/bin/clang++" |
| 100 | + "SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib" |
| 101 | + ] |
| 102 | + ++ lib.optionals (!stdenv.isDarwin) [ "SHLIB_LINK=-lv8" ]; |
105 | 103 |
|
106 | 104 | NIX_LDFLAGS = lib.optionals stdenv.isDarwin [ |
107 | 105 | "-L${postgresql}/lib" |
|
153 | 151 | install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/$LIB_NAME |
154 | 152 | ''} |
155 | 153 |
|
156 | | - ${ |
157 | | - lib.optionalString (!stdenv.isDarwin) '' |
158 | | - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME |
159 | | - '' |
160 | | - } |
| 154 | + ${lib.optionalString (!stdenv.isDarwin) '' |
| 155 | + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME |
| 156 | + ''} |
161 | 157 | else |
162 | 158 | ${lib.optionalString stdenv.isDarwin '' |
163 | 159 | install_name_tool -add_rpath "${v8}/lib" $out/lib/$LIB_NAME |
|
166 | 162 | install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/$LIB_NAME |
167 | 163 | ''} |
168 | 164 |
|
169 | | - ${ |
170 | | - lib.optionalString (!stdenv.isDarwin) '' |
171 | | - ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME |
172 | | - '' |
173 | | - } |
| 165 | + ${lib.optionalString (!stdenv.isDarwin) '' |
| 166 | + ${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${libcxx}/lib" $out/lib/$LIB_NAME |
| 167 | + ''} |
174 | 168 | fi |
175 | 169 |
|
176 | 170 | # plv8 3.2.x removed support for coffeejs and livescript |
|
0 commit comments