From d5c902b1316a2c5cfe65112a7f99df1e2093489d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 9 Dec 2021 00:08:01 +0100 Subject: 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. --- pkgs/servers/sql/postgresql/ext/plv8.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'pkgs/servers/sql/postgresql/ext/plv8.nix') 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; { -- cgit 1.4.1