summary refs log tree commit diff
path: root/pkgs/servers/sql/postgresql/ext/plv8.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/sql/postgresql/ext/plv8.nix')
-rw-r--r--pkgs/servers/sql/postgresql/ext/plv8.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/pkgs/servers/sql/postgresql/ext/plv8.nix b/pkgs/servers/sql/postgresql/ext/plv8.nix
index a546c3a687f..a47ce613da6 100644
--- a/pkgs/servers/sql/postgresql/ext/plv8.nix
+++ b/pkgs/servers/sql/postgresql/ext/plv8.nix
@@ -18,13 +18,21 @@ stdenv.mkDerivation rec {
 
   buildFlags = [ "all" ];
 
+  installFlags = [
+    # PGXS only supports installing to postgresql prefix so we need to redirect this
+    "DESTDIR=${placeholder "out"}"
+  ];
+
   preConfigure = ''
     patchShebangs ./generate_upgrade.sh
   '';
 
-  installPhase = ''
-    install -D plv8*.so                                        -t $out/lib
-    install -D {plls,plcoffee,plv8}{--${version}.sql,.control} -t $out/share/postgresql/extension
+  postInstall = ''
+    # Move the redirected to proper directory.
+    # There appear to be no references to the install directories
+    # so changing them does not cause issues.
+    mv "$out/nix/store"/*/* "$out"
+    rmdir "$out/nix/store"/* "$out/nix/store" "$out/nix"
   '';
 
   meta = with lib; {