2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, postgresql
|
|
|
|
, openssl
|
|
|
|
, zlib
|
|
|
|
, readline
|
|
|
|
, flex
|
2023-05-24 13:37:59 +00:00
|
|
|
, curl
|
|
|
|
, json_c
|
2023-10-09 19:29:22 +00:00
|
|
|
, libxcrypt
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "repmgr";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "5.4.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-05-24 13:37:59 +00:00
|
|
|
owner = "EnterpriseDB";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "repmgr";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-OaEoP1BajVW9dt8On9Ppf8IXmAk47HHv8zKw3WlsLHw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ flex ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = [ postgresql openssl zlib readline curl json_c ]
|
|
|
|
++ lib.optionals (stdenv.isLinux && lib.versionOlder postgresql.version "13") [ libxcrypt ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,lib,share/postgresql/extension}
|
|
|
|
|
|
|
|
cp repmgr{,d} $out/bin
|
|
|
|
cp *.so $out/lib
|
|
|
|
cp *.sql $out/share/postgresql/extension
|
|
|
|
cp *.control $out/share/postgresql/extension
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://repmgr.org/";
|
|
|
|
description = "Replication manager for PostgreSQL cluster";
|
|
|
|
license = licenses.postgresql;
|
|
|
|
platforms = postgresql.meta.platforms;
|
|
|
|
maintainers = with maintainers; [ zimbatm ];
|
|
|
|
};
|
|
|
|
}
|
2023-05-24 13:37:59 +00:00
|
|
|
|