summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-12-09 00:08:01 +0100
committerJan Tojnar <jtojnar@gmail.com>2021-12-09 00:12:21 +0100
commitd5c902b1316a2c5cfe65112a7f99df1e2093489d (patch)
tree9ff93b32d894e5c5c1260b6bc92e47e2168e7426
parentbc5d68306b40b8522ffb69ba6cff91898c2fbbff (diff)
downloadnixpkgs-d5c902b1316a2c5cfe65112a7f99df1e2093489d.tar
nixpkgs-d5c902b1316a2c5cfe65112a7f99df1e2093489d.tar.gz
nixpkgs-d5c902b1316a2c5cfe65112a7f99df1e2093489d.tar.bz2
nixpkgs-d5c902b1316a2c5cfe65112a7f99df1e2093489d.tar.lz
nixpkgs-d5c902b1316a2c5cfe65112a7f99df1e2093489d.tar.xz
nixpkgs-d5c902b1316a2c5cfe65112a7f99df1e2093489d.tar.zst
nixpkgs-d5c902b1316a2c5cfe65112a7f99df1e2093489d.zip
postgresqlPackages.plv8: install all files
Previously, the update complained due to missing migration files:

	db=# alter extension plv8 update to '2.3.15';
	ERROR:  extension "plv8" has no update path from version "2.3.13" to version "2.3.15"

Now it fails for a different reason:

	db=# alter extension plv8 update to '2.3.15';
	ERROR:  could not access file "$libdir/plv8-2.3.13": No such file or directory

Changing installation directory using DESTDIR is an ugly hack that might backfire
but PGXS does not currently seem to allow overriding the installation directory.
-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; {