git.iko.soy/typeable/nixpkgs
on master help sign in
postgresql: add 9.6.1
commit589cc65306229223176010d0b512fd676c491df6 authorBas van Dijk <v.dijk.bas@gmail.com> dateTue 22 Nov 2016, 22:48 (10 years ago) parentf00f4b5
4 files changed+51−11
pkgs/servers/sql/postgresql/default.nix+23−10 pkgs/servers/sql/postgresql/hardcode-pgxs-path-96.patch+14 pkgs/servers/sql/postgresql/less-is-more-96.patch+12 pkgs/top-level/all-packages.nix+2−1
pkgs/servers/sql/postgresql/default.nix+23−10
@@ -1,8 +1,9 @@
1−{ lib, stdenv, fetchurl, zlib, readline, libossp_uuid, openssl }:
1+{ lib, stdenv, glibc, fetchurl, zlib, readline, libossp_uuid, openssl, makeWrapper }:
22
33let
44
5− common = { version, sha256, psqlSchema } @ args: stdenv.mkDerivation (rec {
5+ common = { version, sha256, psqlSchema } @ args:
6+ let atLeast = lib.versionAtLeast version; in stdenv.mkDerivation (rec {
67 name = "postgresql-${version}";
78
89 src = fetchurl {
@@ -14,7 +15,7 @@ let
1415 setOutputFlags = false; # $out retains configureFlags :-/
1516
1617 buildInputs =
17− [ zlib readline openssl ]
18+ [ zlib readline openssl makeWrapper ]
1819 ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
1920
2021 enableParallelBuilding = true;
@@ -30,9 +31,9 @@ let
3031 ++ lib.optional (!stdenv.isDarwin) "--with-ossp-uuid";
3132
3233 patches =
33− [ (if lib.versionAtLeast version "9.4" then ./disable-resolve_symlinks-94.patch else ./disable-resolve_symlinks.patch)
34− ./less-is-more.patch
35− ./hardcode-pgxs-path.patch
34+ [ (if atLeast "9.4" then ./disable-resolve_symlinks-94.patch else ./disable-resolve_symlinks.patch)
35+ (if atLeast "9.6" then ./less-is-more-96.patch else ./less-is-more.patch)
36+ (if atLeast "9.6" then ./hardcode-pgxs-path-96.patch else ./hardcode-pgxs-path.patch)
3637 ./specify_pkglibdir_at_runtime.patch
3738 ];
3839
@@ -41,10 +42,11 @@ let
4142 LC_ALL = "C";
4243
4344 postConfigure =
44− ''
45− # Hardcode the path to pgxs so pg_config returns the path in $out
46− substituteInPlace "src/bin/pg_config/pg_config.c" --replace HARDCODED_PGXS_PATH $out/lib
47− '';
45+ let path = if atLeast "9.6" then "src/common/config_info.c" else "src/bin/pg_config/pg_config.c"; in
46+ ''
47+ # Hardcode the path to pgxs so pg_config returns the path in $out
48+ substituteInPlace "${path}" --replace HARDCODED_PGXS_PATH $out/lib
49+ '';
4850
4951 postInstall =
5052 ''
@@ -56,6 +58,12 @@ let
5658 substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv.cc}/bin/ld ld
5759 '';
5860
61+ postFixup =
62+ ''
63+ # initdb needs access to "locale" command from glibc.
64+ wrapProgram $out/bin/initdb --prefix PATH ":" ${glibc.bin}/bin
65+ '';
66+
5967 disallowedReferences = [ stdenv.cc ];
6068
6169 passthru = {
@@ -104,5 +112,10 @@ in {
104112 sha256 = "1l3fqxlpxgl6nrcd4h6lpi2hsiv56yg83n3xrn704rmdch8mfpng";
105113 };
106114
115+ postgresql96 = common {
116+ version = "9.6.1";
117+ psqlSchema = "9.6";
118+ sha256 = "1k8zwnabsl8f7vlp3azm4lrklkb9jkaxmihqf0mc27ql9451w475";
119+ };
107120
108121}
pkgs/servers/sql/postgresql/hardcode-pgxs-path-96.patchnew file+14
@@ -0,0 +1,14 @@
1+diff -Naur postgresql-9.6.1-orig/src/common/config_info.c postgresql-9.6.1/src/common/config_info.c
2+--- postgresql-9.6.1-orig/src/common/config_info.c 2016-11-22 21:39:29.231929261 +0100
3++++ postgresql-9.6.1/src/common/config_info.c 2016-11-22 23:36:53.685163543 +0100
4+@@ -118,7 +118,10 @@
5+ i++;
6+
7+ configdata[i].name = pstrdup("PGXS");
8++ strlcpy(path, "HARDCODED_PGXS_PATH", sizeof(path));
9++/* commented out to be able to point to nix $out path
10+ get_pkglib_path(my_exec_path, path);
11++*/
12+ strlcat(path, "/pgxs/src/makefiles/pgxs.mk", sizeof(path));
13+ cleanup_path(path);
14+ configdata[i].setting = pstrdup(path);
pkgs/servers/sql/postgresql/less-is-more-96.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -Naur postgresql-9.6.1-orig/src/include/fe_utils/print.h postgresql-9.6.1/src/include/fe_utils/print.h
2+--- postgresql-9.6.1-orig/src/include/fe_utils/print.h 2016-11-22 21:39:29.148932827 +0100
3++++ postgresql-9.6.1/src/include/fe_utils/print.h 2016-11-22 21:39:36.283626258 +0100
4+@@ -18,7 +18,7 @@
5+
6+ /* This is not a particularly great place for this ... */
7+ #ifndef __CYGWIN__
8+-#define DEFAULT_PAGER "more"
9++#define DEFAULT_PAGER "less"
10+ #else
11+ #define DEFAULT_PAGER "less"
12+ #endif
pkgs/top-level/all-packages.nix+2−1
@@ -10324,7 +10324,8 @@ in
1032410324 postgresql92
1032510325 postgresql93
1032610326 postgresql94
10327− postgresql95;
10327+ postgresql95
10328+ postgresql96;
1032810329
1032910330 postgresql_jdbc = callPackage ../servers/sql/postgresql/jdbc { };
1033010331