Fixes #15512 and #16032 With the multi output, postgresql cannot find at runtime what is its basedir when looking for libdir and pkglibdir. This commit fixes that.wip/yesman
parent
f976fa40a2
commit
5b8072fff6
@ -0,0 +1,30 @@ |
||||
import ./make-test.nix ({ pkgs, ...} : { |
||||
name = "postgis"; |
||||
meta = with pkgs.stdenv.lib.maintainers; { |
||||
maintainers = [ lsix ]; |
||||
}; |
||||
|
||||
nodes = { |
||||
master = |
||||
{ pkgs, config, ... }: |
||||
|
||||
{ |
||||
services.postgresql = let mypg = pkgs.postgresql95; in { |
||||
enable = true; |
||||
package = mypg; |
||||
extraPlugins = [ (pkgs.postgis.override { postgresql = mypg; }).v_2_2_1 ]; |
||||
initialScript = pkgs.writeText "postgresql-init.sql" |
||||
'' |
||||
CREATE ROLE postgres WITH superuser login createdb; |
||||
''; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
testScript = '' |
||||
startAll; |
||||
$master->waitForUnit("postgresql"); |
||||
$master->sleep(10); # Hopefully this is long enough!! |
||||
$master->succeed("sudo -u postgres psql -c 'CREATE EXTENSION postgis;'"); |
||||
''; |
||||
}) |
@ -0,0 +1,29 @@ |
||||
diff -ur postgresql-9.5.3-orig/src/port/path.c postgresql-9.5.3/src/port/path.c
|
||||
--- postgresql-9.5.3-orig/src/port/path.c 2016-05-09 22:50:23.000000000 +0200
|
||||
+++ postgresql-9.5.3/src/port/path.c 2016-08-29 22:44:10.507377613 +0200
|
||||
@@ -714,7 +714,11 @@
|
||||
void
|
||||
get_lib_path(const char *my_exec_path, char *ret_path)
|
||||
{
|
||||
- make_relative_path(ret_path, LIBDIR, PGBINDIR, my_exec_path);
|
||||
+ char const * const nix_pglibdir = getenv("NIX_PGLIBDIR");
|
||||
+ if(nix_pglibdir == NULL)
|
||||
+ make_relative_path(ret_path, LIBDIR, PGBINDIR, my_exec_path);
|
||||
+ else
|
||||
+ make_relative_path(ret_path, nix_pglibdir, PGBINDIR, my_exec_path);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -723,7 +727,11 @@
|
||||
void
|
||||
get_pkglib_path(const char *my_exec_path, char *ret_path)
|
||||
{
|
||||
- make_relative_path(ret_path, PKGLIBDIR, PGBINDIR, my_exec_path);
|
||||
+ char const * const nix_pglibdir = getenv("NIX_PGLIBDIR");
|
||||
+ if(nix_pglibdir == NULL)
|
||||
+ make_relative_path(ret_path, PKGLIBDIR, PGBINDIR, my_exec_path);
|
||||
+ else
|
||||
+ make_relative_path(ret_path, nix_pglibdir, PGBINDIR, my_exec_path);
|
||||
}
|
||||
|
||||
/*
|
Loading…
Reference in new issue