2015-07-28 20:37:27 +01: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 04:47:54 +01:00
|
|
|
outputs = [ "out" "lib" "doc" ];
|
|
|
|
setOutputFlags = false; # $out retains configureFlags :-/
|
2015-07-28 20:37:27 +01:00
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ zlib readline openssl ]
|
|
|
|
++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
makeFlags = [ "world" ];
|
|
|
|
|
2015-10-14 04:47:54 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-openssl"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--libdir=$(lib)/lib"
|
|
|
|
]
|
2015-07-28 20:37:27 +01: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
|
2016-05-15 01:37:10 +01:00
|
|
|
./hardcode-pgxs-path.patch
|
2015-07-28 20:37:27 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
installTargets = [ "install-world" ];
|
|
|
|
|
|
|
|
LC_ALL = "C";
|
|
|
|
|
2016-05-15 01:37:10 +01:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2015-07-28 20:37:27 +01:00
|
|
|
postInstall =
|
|
|
|
''
|
2015-12-02 09:03:23 +00:00
|
|
|
moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it
|
|
|
|
moveToOutput "lib/*.a" "$out"
|
|
|
|
moveToOutput "lib/libecpg*" "$out"
|
2015-10-14 04:47:54 +01:00
|
|
|
|
2015-07-28 20:37:27 +01:00
|
|
|
# Prevent a retained dependency on gcc-wrapper.
|
2015-10-14 04:47:54 +01:00
|
|
|
substituteInPlace "$out/lib/pgxs/src/Makefile.global" --replace ${stdenv.cc}/bin/ld ld
|
2015-07-28 20:37:27 +01: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-05-30 19:45:17 +01:00
|
|
|
version = "9.1.21";
|
2015-07-28 20:37:27 +01:00
|
|
|
psqlSchema = "9.1";
|
2016-05-30 19:45:17 +01:00
|
|
|
sha256 = "14xkvv7ph7yh399wppqpil9lgh1vw53nyg5ynk5a8j9idw3yjvnn";
|
2015-07-28 20:37:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql92 = common {
|
2016-05-30 19:47:04 +01:00
|
|
|
version = "9.2.16";
|
2015-07-28 20:37:27 +01:00
|
|
|
psqlSchema = "9.2";
|
2016-05-30 19:47:04 +01:00
|
|
|
sha256 = "048vfkq58kkhcrw5vj4vplgvxia1k0lrbhbi30b2iy3bf2w4q5nj";
|
2015-07-28 20:37:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql93 = common {
|
2016-05-30 19:48:50 +01:00
|
|
|
version = "9.3.12";
|
2015-07-28 20:37:27 +01:00
|
|
|
psqlSchema = "9.3";
|
2016-05-30 19:48:50 +01:00
|
|
|
sha256 = "0rrf24mw68lwxjjnbbaayizhhcylwnr7ij5d60vpzl467yi9wczk";
|
2015-07-28 20:37:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql94 = common {
|
2016-05-30 19:50:36 +01:00
|
|
|
version = "9.4.7";
|
2015-07-28 20:37:27 +01:00
|
|
|
psqlSchema = "9.4";
|
2016-05-30 19:50:36 +01:00
|
|
|
sha256 = "1q41bwwa4x1ff2qzlrsfia25ys5gfrihbqwib1z6j3mk6mn5wyfc";
|
2015-07-28 20:37:27 +01:00
|
|
|
};
|
|
|
|
|
2016-01-08 15:47:03 +00:00
|
|
|
postgresql95 = common {
|
2016-05-30 19:52:23 +01:00
|
|
|
version = "9.5.3";
|
2016-01-08 15:47:03 +00:00
|
|
|
psqlSchema = "9.5";
|
2016-05-30 19:52:23 +01:00
|
|
|
sha256 = "1d500d2qsdzysnis6qi84xchnz5xh8kx8sjfmkbsijwaqlfw11bk";
|
2016-01-08 15:47:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-07-28 20:37:27 +01:00
|
|
|
}
|