From 912a825d1e9c41d596e43d7440667a1882a0cb6d Mon Sep 17 00:00:00 2001 From: Oliver Charles Date: Thu, 27 Jun 2013 14:08:42 +0100 Subject: Disable exec symlink resolution for PostgreSQL 9.2 When building PostgreSQL with plugins under NixOS, NixOS will create a postgresql-and-plugins directory which symlinks PostgreSQL and all the plugins into a single directory. Unfortunately, the plugins will not actually be usable by PostgreSQL because it will still try and locate them in the original PostgreSQL share directory, not postgresql-and-plugins. In this commit, I have patched resolve_symlinks to always return success, which matches the behavior if HAVE_READLINK is false (so presumably invalid paths are never passed to this function). --- pkgs/servers/sql/postgresql/9.2.x.nix | 2 ++ pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch (limited to 'pkgs/servers') diff --git a/pkgs/servers/sql/postgresql/9.2.x.nix b/pkgs/servers/sql/postgresql/9.2.x.nix index 46a6aa0c032..ada8ee7a4f3 100644 --- a/pkgs/servers/sql/postgresql/9.2.x.nix +++ b/pkgs/servers/sql/postgresql/9.2.x.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { makeFlags = [ "world" ]; + patches = [ ./disable-resolve_symlinks.patch ]; + installTargets = [ "install-world" ]; LC_ALL = "C"; diff --git a/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch b/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch new file mode 100644 index 00000000000..3e6fd5e838a --- /dev/null +++ b/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch @@ -0,0 +1,14 @@ +diff --git a/src/port/exec.c b/src/port/exec.c +index c79e8ba..42c4091 100644 +--- a/src/port/exec.c ++++ b/src/port/exec.c +@@ -216,6 +216,9 @@ find_my_exec(const char *argv0, char *retpath) + static int + resolve_symlinks(char *path) + { ++ // On NixOS we *want* stuff relative to symlinks. ++ return 0; ++ + #ifdef HAVE_READLINK + struct stat buf; + char orig_wd[MAXPGPATH], -- cgit 1.4.1