From 73f56ae19126109caa02bdfdc42ac2e633de00be Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Mon, 6 Aug 2018 10:17:49 -0500 Subject: nixpkgs: move postgresql patches into a common directory This simply makes it easier to browse the PostgreSQL package directory. More to come. Signed-off-by: Austin Seipp --- pkgs/servers/sql/postgresql/default.nix | 8 +++--- .../postgresql/disable-resolve_symlinks-94.patch | 12 --------- .../sql/postgresql/disable-resolve_symlinks.patch | 14 ----------- .../sql/postgresql/hardcode-pgxs-path-96.patch | 14 ----------- .../sql/postgresql/hardcode-pgxs-path.patch | 17 ------------- pkgs/servers/sql/postgresql/less-is-more-96.patch | 12 --------- pkgs/servers/sql/postgresql/less-is-more.patch | 12 --------- .../patches/disable-resolve_symlinks-94.patch | 12 +++++++++ .../patches/disable-resolve_symlinks.patch | 14 +++++++++++ .../postgresql/patches/hardcode-pgxs-path-96.patch | 14 +++++++++++ .../postgresql/patches/hardcode-pgxs-path.patch | 17 +++++++++++++ .../sql/postgresql/patches/less-is-more-96.patch | 12 +++++++++ .../sql/postgresql/patches/less-is-more.patch | 12 +++++++++ .../patches/specify_pkglibdir_at_runtime.patch | 29 ++++++++++++++++++++++ .../postgresql/specify_pkglibdir_at_runtime.patch | 29 ---------------------- 15 files changed, 114 insertions(+), 114 deletions(-) delete mode 100644 pkgs/servers/sql/postgresql/disable-resolve_symlinks-94.patch delete mode 100644 pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch delete mode 100644 pkgs/servers/sql/postgresql/hardcode-pgxs-path-96.patch delete mode 100644 pkgs/servers/sql/postgresql/hardcode-pgxs-path.patch delete mode 100644 pkgs/servers/sql/postgresql/less-is-more-96.patch delete mode 100644 pkgs/servers/sql/postgresql/less-is-more.patch create mode 100644 pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks-94.patch create mode 100644 pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks.patch create mode 100644 pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path-96.patch create mode 100644 pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch create mode 100644 pkgs/servers/sql/postgresql/patches/less-is-more-96.patch create mode 100644 pkgs/servers/sql/postgresql/patches/less-is-more.patch create mode 100644 pkgs/servers/sql/postgresql/patches/specify_pkglibdir_at_runtime.patch delete mode 100644 pkgs/servers/sql/postgresql/specify_pkglibdir_at_runtime.patch (limited to 'pkgs') diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix index b8c06d5ec2f5..2b22c36e829f 100644 --- a/pkgs/servers/sql/postgresql/default.nix +++ b/pkgs/servers/sql/postgresql/default.nix @@ -48,10 +48,10 @@ let ] ++ lib.optionals icuEnabled [ "--with-icu" ]; patches = - [ (if atLeast "9.4" then ./disable-resolve_symlinks-94.patch else ./disable-resolve_symlinks.patch) - (if atLeast "9.6" then ./less-is-more-96.patch else ./less-is-more.patch) - (if atLeast "9.6" then ./hardcode-pgxs-path-96.patch else ./hardcode-pgxs-path.patch) - ./specify_pkglibdir_at_runtime.patch + [ (if atLeast "9.4" then ./patches/disable-resolve_symlinks-94.patch else ./patches/disable-resolve_symlinks.patch) + (if atLeast "9.6" then ./patches/less-is-more-96.patch else ./patches/less-is-more.patch) + (if atLeast "9.6" then ./patches/hardcode-pgxs-path-96.patch else ./patches/hardcode-pgxs-path.patch) + ./patches/specify_pkglibdir_at_runtime.patch ]; installTargets = [ "install-world" ]; diff --git a/pkgs/servers/sql/postgresql/disable-resolve_symlinks-94.patch b/pkgs/servers/sql/postgresql/disable-resolve_symlinks-94.patch deleted file mode 100644 index fadeea90ac4b..000000000000 --- a/pkgs/servers/sql/postgresql/disable-resolve_symlinks-94.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/src/common/exec.c 2014-09-04 20:19:12.236057588 +0200 -+++ b/src/common/exec.c 2014-09-04 20:19:50.550251633 +0200 -@@ -218,6 +218,9 @@ - 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], diff --git a/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch b/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch deleted file mode 100644 index 3e6fd5e838a2..000000000000 --- a/pkgs/servers/sql/postgresql/disable-resolve_symlinks.patch +++ /dev/null @@ -1,14 +0,0 @@ -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], diff --git a/pkgs/servers/sql/postgresql/hardcode-pgxs-path-96.patch b/pkgs/servers/sql/postgresql/hardcode-pgxs-path-96.patch deleted file mode 100644 index 6cd449769baa..000000000000 --- a/pkgs/servers/sql/postgresql/hardcode-pgxs-path-96.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Naur postgresql-9.6.1-orig/src/common/config_info.c postgresql-9.6.1/src/common/config_info.c ---- postgresql-9.6.1-orig/src/common/config_info.c 2016-11-22 21:39:29.231929261 +0100 -+++ postgresql-9.6.1/src/common/config_info.c 2016-11-22 23:36:53.685163543 +0100 -@@ -118,7 +118,10 @@ - i++; - - configdata[i].name = pstrdup("PGXS"); -+ strlcpy(path, "HARDCODED_PGXS_PATH", sizeof(path)); -+/* commented out to be able to point to nix $out path - get_pkglib_path(my_exec_path, path); -+*/ - strlcat(path, "/pgxs/src/makefiles/pgxs.mk", sizeof(path)); - cleanup_path(path); - configdata[i].setting = pstrdup(path); diff --git a/pkgs/servers/sql/postgresql/hardcode-pgxs-path.patch b/pkgs/servers/sql/postgresql/hardcode-pgxs-path.patch deleted file mode 100644 index 355813ffe20e..000000000000 --- a/pkgs/servers/sql/postgresql/hardcode-pgxs-path.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/src/bin/pg_config/pg_config.c -+++ b/src/bin/pg_config/pg_config.c -@@ -220,11 +220,13 @@ show_sysconfdir(bool all) - static void - show_pgxs(bool all) - { -- char path[MAXPGPATH]; -+ char path[MAXPGPATH] = "HARDCODED_PGXS_PATH"; - - if (all) - printf("PGXS = "); -+ /* commented out to be able to point to nix $out path - get_pkglib_path(mypath, path); -+ */ - strlcat(path, "/pgxs/src/makefiles/pgxs.mk", sizeof(path)); - cleanup_path(path); - printf("%s\n", path); diff --git a/pkgs/servers/sql/postgresql/less-is-more-96.patch b/pkgs/servers/sql/postgresql/less-is-more-96.patch deleted file mode 100644 index f14af9dc2207..000000000000 --- a/pkgs/servers/sql/postgresql/less-is-more-96.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur postgresql-9.6.1-orig/src/include/fe_utils/print.h postgresql-9.6.1/src/include/fe_utils/print.h ---- postgresql-9.6.1-orig/src/include/fe_utils/print.h 2016-11-22 21:39:29.148932827 +0100 -+++ postgresql-9.6.1/src/include/fe_utils/print.h 2016-11-22 21:39:36.283626258 +0100 -@@ -18,7 +18,7 @@ - - /* This is not a particularly great place for this ... */ - #ifndef __CYGWIN__ --#define DEFAULT_PAGER "more" -+#define DEFAULT_PAGER "less" - #else - #define DEFAULT_PAGER "less" - #endif diff --git a/pkgs/servers/sql/postgresql/less-is-more.patch b/pkgs/servers/sql/postgresql/less-is-more.patch deleted file mode 100644 index d640d24bdaad..000000000000 --- a/pkgs/servers/sql/postgresql/less-is-more.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur postgresql-9.2.7-orig/src/bin/psql/print.h postgresql-9.2.7/src/bin/psql/print.h ---- postgresql-9.2.7-orig/src/bin/psql/print.h 2014-02-17 14:38:15.000000000 -0500 -+++ postgresql-9.2.7/src/bin/psql/print.h 2014-03-04 14:42:28.874014415 -0500 -@@ -178,7 +178,7 @@ - extern const printTextFormat *get_line_style(const printTableOpt *opt); - - #ifndef __CYGWIN__ --#define DEFAULT_PAGER "more" -+#define DEFAULT_PAGER "less" - #else - #define DEFAULT_PAGER "less" - #endif diff --git a/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks-94.patch b/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks-94.patch new file mode 100644 index 000000000000..fadeea90ac4b --- /dev/null +++ b/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks-94.patch @@ -0,0 +1,12 @@ +--- a/src/common/exec.c 2014-09-04 20:19:12.236057588 +0200 ++++ b/src/common/exec.c 2014-09-04 20:19:50.550251633 +0200 +@@ -218,6 +218,9 @@ + 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], diff --git a/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks.patch b/pkgs/servers/sql/postgresql/patches/disable-resolve_symlinks.patch new file mode 100644 index 000000000000..3e6fd5e838a2 --- /dev/null +++ b/pkgs/servers/sql/postgresql/patches/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], diff --git a/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path-96.patch b/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path-96.patch new file mode 100644 index 000000000000..6cd449769baa --- /dev/null +++ b/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path-96.patch @@ -0,0 +1,14 @@ +diff -Naur postgresql-9.6.1-orig/src/common/config_info.c postgresql-9.6.1/src/common/config_info.c +--- postgresql-9.6.1-orig/src/common/config_info.c 2016-11-22 21:39:29.231929261 +0100 ++++ postgresql-9.6.1/src/common/config_info.c 2016-11-22 23:36:53.685163543 +0100 +@@ -118,7 +118,10 @@ + i++; + + configdata[i].name = pstrdup("PGXS"); ++ strlcpy(path, "HARDCODED_PGXS_PATH", sizeof(path)); ++/* commented out to be able to point to nix $out path + get_pkglib_path(my_exec_path, path); ++*/ + strlcat(path, "/pgxs/src/makefiles/pgxs.mk", sizeof(path)); + cleanup_path(path); + configdata[i].setting = pstrdup(path); diff --git a/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch b/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch new file mode 100644 index 000000000000..355813ffe20e --- /dev/null +++ b/pkgs/servers/sql/postgresql/patches/hardcode-pgxs-path.patch @@ -0,0 +1,17 @@ +--- a/src/bin/pg_config/pg_config.c ++++ b/src/bin/pg_config/pg_config.c +@@ -220,11 +220,13 @@ show_sysconfdir(bool all) + static void + show_pgxs(bool all) + { +- char path[MAXPGPATH]; ++ char path[MAXPGPATH] = "HARDCODED_PGXS_PATH"; + + if (all) + printf("PGXS = "); ++ /* commented out to be able to point to nix $out path + get_pkglib_path(mypath, path); ++ */ + strlcat(path, "/pgxs/src/makefiles/pgxs.mk", sizeof(path)); + cleanup_path(path); + printf("%s\n", path); diff --git a/pkgs/servers/sql/postgresql/patches/less-is-more-96.patch b/pkgs/servers/sql/postgresql/patches/less-is-more-96.patch new file mode 100644 index 000000000000..f14af9dc2207 --- /dev/null +++ b/pkgs/servers/sql/postgresql/patches/less-is-more-96.patch @@ -0,0 +1,12 @@ +diff -Naur postgresql-9.6.1-orig/src/include/fe_utils/print.h postgresql-9.6.1/src/include/fe_utils/print.h +--- postgresql-9.6.1-orig/src/include/fe_utils/print.h 2016-11-22 21:39:29.148932827 +0100 ++++ postgresql-9.6.1/src/include/fe_utils/print.h 2016-11-22 21:39:36.283626258 +0100 +@@ -18,7 +18,7 @@ + + /* This is not a particularly great place for this ... */ + #ifndef __CYGWIN__ +-#define DEFAULT_PAGER "more" ++#define DEFAULT_PAGER "less" + #else + #define DEFAULT_PAGER "less" + #endif diff --git a/pkgs/servers/sql/postgresql/patches/less-is-more.patch b/pkgs/servers/sql/postgresql/patches/less-is-more.patch new file mode 100644 index 000000000000..d640d24bdaad --- /dev/null +++ b/pkgs/servers/sql/postgresql/patches/less-is-more.patch @@ -0,0 +1,12 @@ +diff -Naur postgresql-9.2.7-orig/src/bin/psql/print.h postgresql-9.2.7/src/bin/psql/print.h +--- postgresql-9.2.7-orig/src/bin/psql/print.h 2014-02-17 14:38:15.000000000 -0500 ++++ postgresql-9.2.7/src/bin/psql/print.h 2014-03-04 14:42:28.874014415 -0500 +@@ -178,7 +178,7 @@ + extern const printTextFormat *get_line_style(const printTableOpt *opt); + + #ifndef __CYGWIN__ +-#define DEFAULT_PAGER "more" ++#define DEFAULT_PAGER "less" + #else + #define DEFAULT_PAGER "less" + #endif diff --git a/pkgs/servers/sql/postgresql/patches/specify_pkglibdir_at_runtime.patch b/pkgs/servers/sql/postgresql/patches/specify_pkglibdir_at_runtime.patch new file mode 100644 index 000000000000..fe95d2ee99f0 --- /dev/null +++ b/pkgs/servers/sql/postgresql/patches/specify_pkglibdir_at_runtime.patch @@ -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); + } + + /* diff --git a/pkgs/servers/sql/postgresql/specify_pkglibdir_at_runtime.patch b/pkgs/servers/sql/postgresql/specify_pkglibdir_at_runtime.patch deleted file mode 100644 index fe95d2ee99f0..000000000000 --- a/pkgs/servers/sql/postgresql/specify_pkglibdir_at_runtime.patch +++ /dev/null @@ -1,29 +0,0 @@ -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); - } - - /* -- cgit 1.4.1