2015-07-28 21:37:27 +02:00
|
|
|
{ lib, stdenv, fetchurl, zlib, readline, libossp_uuid, openssl }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
common = { version, sha256, psqlSchema } @ args: stdenv.mkDerivation (rec {
|
|
|
|
name = "postgresql-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2015-10-14 05:47:54 +02:00
|
|
|
outputs = [ "out" "lib" "doc" ];
|
|
|
|
setOutputFlags = false; # $out retains configureFlags :-/
|
2015-07-28 21:37:27 +02:00
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ zlib readline openssl ]
|
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
makeFlags = [ "world" ];
|
|
|
|
|
2015-10-14 05:47:54 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--with-openssl"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--libdir=$(lib)/lib"
|
|
|
|
]
|
2015-07-28 21:37:27 +02:00
|
|
|
++ lib.optional (stdenv.isDarwin) "--with-uuid=e2fs"
|
|
|
|
++ 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
|
|
|
|
];
|
|
|
|
|
|
|
|
installTargets = [ "install-world" ];
|
|
|
|
|
|
|
|
LC_ALL = "C";
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
''
|
2015-12-02 10:03:23 +01:00
|
|
|
moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it
|
|
|
|
moveToOutput "lib/*.a" "$out"
|
|
|
|
moveToOutput "lib/libecpg*" "$out"
|
2015-10-14 05:47:54 +02:00
|
|
|
|
2015-07-28 21:37:27 +02:00
|
|
|
# Prevent a retained dependency on gcc-wrapper.
|
2015-10-14 05:47:54 +02:00
|
|
|
substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv.cc}/bin/ld ld
|
2015-07-28 21:37:27 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
disallowedReferences = [ stdenv.cc ];
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit readline psqlSchema;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = http://www.postgresql.org/;
|
|
|
|
description = "A powerful, open source object-relational database system";
|
|
|
|
license = licenses.postgresql;
|
|
|
|
maintainers = [ maintainers.ocharles ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
hydraPlatforms = platforms.linux;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
postgresql91 = common {
|
2016-02-12 13:12:10 +01:00
|
|
|
version = "9.1.20";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.1";
|
2016-02-12 13:12:10 +01:00
|
|
|
sha256 = "0dr9hz1a0ax30f6jvnv2rck0zzxgk9x7nh4n1xgshrf26i1nq7kd";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql92 = common {
|
2016-02-12 13:12:10 +01:00
|
|
|
version = "9.2.15";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.2";
|
2016-02-12 13:12:10 +01:00
|
|
|
sha256 = "0q1yahkfys78crf59avp02ibd0lp3z7h626xchyfi6cqb03livbw";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql93 = common {
|
2016-02-12 13:12:10 +01:00
|
|
|
version = "9.3.11";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.3";
|
2016-02-12 13:12:10 +01:00
|
|
|
sha256 = "08ba951nfiy516flaw352shj1zslxg4ryx3w5k0adls1r682l8ix";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql94 = common {
|
2016-02-12 13:12:10 +01:00
|
|
|
version = "9.4.6";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.4";
|
2016-02-12 13:12:10 +01:00
|
|
|
sha256 = "19j0845i195ksg9pvnk3yc2fr62i7ii2bqgbidfjq556056izknb";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
2016-01-08 16:47:03 +01:00
|
|
|
postgresql95 = common {
|
2016-02-12 13:12:10 +01:00
|
|
|
version = "9.5.1";
|
2016-01-08 16:47:03 +01:00
|
|
|
psqlSchema = "9.5";
|
2016-02-12 13:12:10 +01:00
|
|
|
sha256 = "1ljvijaja5zy4i5b1450drbj8m3fcm3ly1zzaakp75x30s2rsc3b";
|
2016-01-08 16:47:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-07-28 21:37:27 +02:00
|
|
|
}
|