1--- a/src/port/path.c
2+++ b/src/port/path.c
3@@ -714,7 +714,11 @@
4 void
5 get_lib_path(const char *my_exec_path, char *ret_path)
6 {
7- make_relative_path(ret_path, LIBDIR, PGBINDIR, my_exec_path);
8+ char const * const nix_pglibdir = getenv("NIX_PGLIBDIR");
9+ if(nix_pglibdir == NULL)
10+ make_relative_path(ret_path, LIBDIR, PGBINDIR, my_exec_path);
11+ else
12+ make_relative_path(ret_path, nix_pglibdir, PGBINDIR, my_exec_path);
13 }
14
15 /*
16@@ -723,7 +727,11 @@
17 void
18 get_pkglib_path(const char *my_exec_path, char *ret_path)
19 {
20- make_relative_path(ret_path, PKGLIBDIR, PGBINDIR, my_exec_path);
21+ char const * const nix_pglibdir = getenv("NIX_PGLIBDIR");
22+ if(nix_pglibdir == NULL)
23+ make_relative_path(ret_path, PKGLIBDIR, PGBINDIR, my_exec_path);
24+ else
25+ make_relative_path(ret_path, nix_pglibdir, PGBINDIR, my_exec_path);
26 }
27
28 /*