diff options
Diffstat (limited to 'pkgs/servers/sql/postgresql/default.nix')
-rw-r--r-- | pkgs/servers/sql/postgresql/default.nix | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix index c0e97dab8125..d5ffd5361e45 100644 --- a/pkgs/servers/sql/postgresql/default.nix +++ b/pkgs/servers/sql/postgresql/default.nix @@ -1,8 +1,9 @@ -{ lib, stdenv, fetchurl, zlib, readline, libossp_uuid, openssl }: +{ lib, stdenv, glibc, fetchurl, zlib, readline, libossp_uuid, openssl, makeWrapper }: let - common = { version, sha256, psqlSchema } @ args: stdenv.mkDerivation (rec { + common = { version, sha256, psqlSchema } @ args: + let atLeast = lib.versionAtLeast version; in stdenv.mkDerivation (rec { name = "postgresql-${version}"; src = fetchurl { @@ -14,7 +15,7 @@ let setOutputFlags = false; # $out retains configureFlags :-/ buildInputs = - [ zlib readline openssl ] + [ zlib readline openssl makeWrapper ] ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ]; enableParallelBuilding = true; @@ -30,9 +31,9 @@ let ++ lib.optional (!stdenv.isDarwin) "--with-ossp-uuid"; patches = - [ (if lib.versionAtLeast version "9.4" then ./disable-resolve_symlinks-94.patch else ./disable-resolve_symlinks.patch) - ./less-is-more.patch - ./hardcode-pgxs-path.patch + [ (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 ]; @@ -41,10 +42,11 @@ let LC_ALL = "C"; postConfigure = - '' - # Hardcode the path to pgxs so pg_config returns the path in $out - substituteInPlace "src/bin/pg_config/pg_config.c" --replace HARDCODED_PGXS_PATH $out/lib - ''; + let path = if atLeast "9.6" then "src/common/config_info.c" else "src/bin/pg_config/pg_config.c"; in + '' + # Hardcode the path to pgxs so pg_config returns the path in $out + substituteInPlace "${path}" --replace HARDCODED_PGXS_PATH $out/lib + ''; postInstall = '' @@ -56,6 +58,12 @@ let substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv.cc}/bin/ld ld ''; + postFixup = lib.optionalString (!stdenv.isDarwin) + '' + # initdb needs access to "locale" command from glibc. + wrapProgram $out/bin/initdb --prefix PATH ":" ${glibc.bin}/bin + ''; + disallowedReferences = [ stdenv.cc ]; passthru = { @@ -75,34 +83,39 @@ let in { postgresql91 = common { - version = "9.1.23"; + version = "9.1.24"; psqlSchema = "9.1"; - sha256 = "1mgnfm65fspkq62skfy48rjkprnxcfhydw0x3ipp4sdkngl72x3z"; + sha256 = "1lz5ibvgz6cxprxlnd7a8iwv387idr7k53bdsvy4bw9ayglq83fy"; }; postgresql92 = common { - version = "9.2.18"; + version = "9.2.19"; psqlSchema = "9.2"; - sha256 = "1x1mxbwqvgj9s4y8pb4vv6fmmr36z5zl3b2ggb84ckdfhvakganp"; + sha256 = "1bfvx1h1baxp40y4xi88974p43vazz13mwc0h8scq3sr9wxdfa8x"; }; postgresql93 = common { - version = "9.3.14"; + version = "9.3.15"; psqlSchema = "9.3"; - sha256 = "1783kl0abf9az90mvs08pdh63d33cv2njc1q515zz89bqkqj4hsw"; + sha256 = "0kswvs4rzcmjz12hhyi61w5x2wh4dxskar8v7rgajfm98qabmz59"; }; postgresql94 = common { - version = "9.4.9"; + version = "9.4.10"; psqlSchema = "9.4"; - sha256 = "1jg1l6vrfwhfyqrx07bgcpqxb5zcp8zwm8qd2vcj0k11j0pac861"; + sha256 = "1kvfhalf3rs59887b5qa14zp85zcnsc6pislrs0wd08rxn5nfqbh"; }; postgresql95 = common { - version = "9.5.4"; + version = "9.5.5"; psqlSchema = "9.5"; - sha256 = "1l3fqxlpxgl6nrcd4h6lpi2hsiv56yg83n3xrn704rmdch8mfpng"; + sha256 = "157kf6mdazmxfmd11f0akya2xcz6sfgprn7yqc26dpklps855ih2"; }; + postgresql96 = common { + version = "9.6.1"; + psqlSchema = "9.6"; + sha256 = "1k8zwnabsl8f7vlp3azm4lrklkb9jkaxmihqf0mc27ql9451w475"; + }; } |