Skip to content

Commit 6c50c09

Browse files
committed
fix: now builds correct and enable on aarch64-linux
1 parent 25428b6 commit 6c50c09

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

nix/ext/plv8.nix

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
{ stdenv
42
, lib
53
, fetchFromGitHub
@@ -58,24 +56,33 @@ stdenv.mkDerivation (finalAttrs: {
5856
"CC=${clang}/bin/clang"
5957
"CXX=${clang}/bin/clang++"
6058
"SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib"
59+
] ++ lib.optionals (!stdenv.isDarwin) [
60+
"SHLIB_LINK=-L${v8}/lib -lv8_monolith -Wl,-rpath,${v8}/lib"
6161
];
6262

63-
NIX_LDFLAGS = lib.optionals stdenv.isDarwin (lib.concatStringsSep " " [
63+
NIX_LDFLAGS = (lib.optionals stdenv.isDarwin [
6464
"-L${postgresql}/lib"
6565
"-L${v8}/lib"
6666
"-lv8_monolith"
6767
"-lpq"
6868
"-lpgcommon"
6969
"-lpgport"
7070
"-F${darwin.apple_sdk.frameworks.CoreFoundation}/Library/Frameworks"
71-
"-framework CoreFoundation"
71+
"-framework" "CoreFoundation"
7272
"-F${darwin.apple_sdk.frameworks.Kerberos}/Library/Frameworks"
73-
"-framework Kerberos"
74-
"-undefined dynamic_lookup"
73+
"-framework" "Kerberos"
74+
"-undefined" "dynamic_lookup"
7575
"-flat_namespace"
76+
]) ++ (lib.optionals (!stdenv.isDarwin) [
77+
"-L${postgresql}/lib"
78+
"-L${v8}/lib"
79+
"-lv8_monolith"
80+
"-lpq"
81+
"-lpgcommon"
82+
"-lpgport"
7683
]);
7784

78-
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
85+
NIX_CFLAGS_COMPILE = [
7986
"-I${v8}/include"
8087
"-I${postgresql}/include"
8188
"-I${postgresql}/include/server"
@@ -114,6 +121,10 @@ stdenv.mkDerivation (finalAttrs: {
114121
install_name_tool -add_rpath "${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}.so
115122
install_name_tool -change @rpath/libv8_monolith.dylib ${v8}/lib/libv8_monolith.dylib $out/lib/plv8-${finalAttrs.version}.so
116123
''}
124+
125+
${lib.optionalString (!stdenv.isDarwin) ''
126+
${patchelf}/bin/patchelf --set-rpath "${v8}/lib:${postgresql}/lib:${stdenv.cc.cc.lib}/lib" $out/lib/plv8-${finalAttrs.version}.so
127+
''}
117128
'';
118129

119130
passthru = {

0 commit comments

Comments
 (0)