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-10-14 05:47:54 +02:00
|
|
|
_moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it
|
|
|
|
_moveToOutput "lib/*.a" "$out"
|
|
|
|
_moveToOutput "lib/libecpg*" "$out"
|
|
|
|
|
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 {
|
|
|
|
|
|
|
|
postgresql90 = common {
|
2015-10-25 02:39:01 +02:00
|
|
|
version = "9.0.23";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.0";
|
2015-10-25 02:39:01 +02:00
|
|
|
sha256 = "1pnpni95r0ry112z6ycrqk5m6iw0vd4npg789czrl4qlr0cvxg1x";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql91 = common {
|
2015-10-25 02:39:01 +02:00
|
|
|
version = "9.1.19";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.1";
|
2015-10-25 02:39:01 +02:00
|
|
|
sha256 = "1ihf9h353agsm5p2dr717dvraxvsw6j7chbn3qxdcz8la5s0bmfb";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql92 = common {
|
2015-10-25 02:39:01 +02:00
|
|
|
version = "9.2.14";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.2";
|
2015-10-25 02:39:01 +02:00
|
|
|
sha256 = "0bi9zfsfhj84mnaa41ar63j9qgzsnac1wwgjhy2c6j0a68zhphjl";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql93 = common {
|
2015-10-25 02:39:01 +02:00
|
|
|
version = "9.3.10";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.3";
|
2015-10-25 02:39:01 +02:00
|
|
|
sha256 = "0c8mailildnqnndwpmnqf8ymxmk1qf5w5dq02hjqmydgfq7lyi75";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postgresql94 = common {
|
2015-10-25 02:39:01 +02:00
|
|
|
version = "9.4.5";
|
2015-07-28 21:37:27 +02:00
|
|
|
psqlSchema = "9.4";
|
2015-10-25 02:39:01 +02:00
|
|
|
sha256 = "0faav7k3nlhh1z7j1r3adrhx1fpsji3jixmm2abjm93fdg350z5q";
|
2015-07-28 21:37:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|