summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2022-01-08 15:37:44 +0300
committerNikolay Amiantov <ab@fmap.me>2022-01-08 18:24:55 +0300
commita4c6e9e084347417024fa1d175c9951de3c80166 (patch)
tree66f86f8094cce1fab2dc6c318a086977d22a71bd
parent7b161cef226d3eba674918d58bae77046d2fd91a (diff)
downloadnixpkgs-a4c6e9e084347417024fa1d175c9951de3c80166.tar
nixpkgs-a4c6e9e084347417024fa1d175c9951de3c80166.tar.gz
nixpkgs-a4c6e9e084347417024fa1d175c9951de3c80166.tar.bz2
nixpkgs-a4c6e9e084347417024fa1d175c9951de3c80166.tar.lz
nixpkgs-a4c6e9e084347417024fa1d175c9951de3c80166.tar.xz
nixpkgs-a4c6e9e084347417024fa1d175c9951de3c80166.tar.zst
nixpkgs-a4c6e9e084347417024fa1d175c9951de3c80166.zip
postgresqlPackages.plv8: 2.3.15 -> 3.0.0
Use v8 8.8.x.
-rw-r--r--pkgs/servers/sql/postgresql/ext/plv8.nix14
-rw-r--r--pkgs/servers/sql/postgresql/packages.nix4
2 files changed, 13 insertions, 5 deletions
diff --git a/pkgs/servers/sql/postgresql/ext/plv8.nix b/pkgs/servers/sql/postgresql/ext/plv8.nix
index 6f5411340e4..3fc6460adad 100644
--- a/pkgs/servers/sql/postgresql/ext/plv8.nix
+++ b/pkgs/servers/sql/postgresql/ext/plv8.nix
@@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
   ];
 
   preConfigure = ''
+    # We build V8 as a monolith, so this is unnecessary.
+    substituteInPlace Makefile.shared --replace "-lv8_libplatform" ""
     patchShebangs ./generate_upgrade.sh
     substituteInPlace generate_upgrade.sh \
       --replace " 2.3.10)" " 2.3.10 2.3.11 2.3.12 2.3.13 2.3.14 2.3.15)"
@@ -42,10 +44,14 @@ stdenv.mkDerivation rec {
     rmdir "$out/nix/store"/* "$out/nix/store" "$out/nix"
   '';
 
-  # Without this, PostgreSQL will crash at runtime.
-  # The flags are only included in Makefile, not Makefile.shared.
-  # https://github.com/plv8/plv8/pull/469
-  NIX_CFLAGS_COMPILE = "-DJSONB_DIRECT_CONVERSION -DV8_COMPRESS_POINTERS=1 -DV8_31BIT_SMIS_ON_64BIT_ARCH=1";
+  NIX_CFLAGS_COMPILE = [
+    # V8 depends on C++14.
+    "-std=c++14"
+    # Without this, PostgreSQL will crash at runtime.
+    # The flags are only included in Makefile, not Makefile.shared.
+    # https://github.com/plv8/plv8/pull/469
+    "-DJSONB_DIRECT_CONVERSION" "-DV8_COMPRESS_POINTERS=1" "-DV8_31BIT_SMIS_ON_64BIT_ARCH=1"
+  ];
 
   meta = with lib; {
     description = "V8 Engine Javascript Procedural Language add-on for PostgreSQL";
diff --git a/pkgs/servers/sql/postgresql/packages.nix b/pkgs/servers/sql/postgresql/packages.nix
index e751ae621f3..f3df8a99ca2 100644
--- a/pkgs/servers/sql/postgresql/packages.nix
+++ b/pkgs/servers/sql/postgresql/packages.nix
@@ -26,7 +26,9 @@ self: super: {
 
     plr = super.callPackage ./ext/plr.nix { };
 
-    plv8 = super.callPackage ./ext/plv8.nix { };
+    plv8 = super.callPackage ./ext/plv8.nix {
+      v8 = self.v8_8_x;
+    };
 
     pgjwt = super.callPackage ./ext/pgjwt.nix { };