2021-02-24 17:36:49 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, bash
|
|
|
|
, bzip2
|
|
|
|
, corosync
|
|
|
|
, dbus
|
|
|
|
, fetchFromGitHub
|
|
|
|
, glib
|
|
|
|
, gnutls
|
|
|
|
, libqb
|
|
|
|
, libtool
|
|
|
|
, libuuid
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, pam
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
2022-03-08 01:46:26 +00:00
|
|
|
, nixosTests
|
2021-02-24 17:36:49 +00:00
|
|
|
|
|
|
|
# Pacemaker is compiled twice, once with forOCF = true to extract its
|
|
|
|
# OCF definitions for use in the ocf-resource-agents derivation, then
|
|
|
|
# again with forOCF = false, where the ocf-resource-agents is provided
|
|
|
|
# as the OCF_ROOT.
|
|
|
|
, forOCF ? false
|
|
|
|
, ocf-resource-agents
|
|
|
|
} :
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pacemaker";
|
2023-05-28 06:39:28 +00:00
|
|
|
version = "2.1.6";
|
2021-02-24 17:36:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ClusterLabs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "Pacemaker-${version}";
|
2023-05-28 06:39:28 +00:00
|
|
|
sha256 = "sha256-3+eRQ3NqPusdFhKc0wE7UMMNKsDLRVvh+EhD6zYGoP0=";
|
2021-02-24 17:36:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
libtool
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bash
|
|
|
|
bzip2
|
|
|
|
corosync
|
|
|
|
dbus.dev
|
|
|
|
glib
|
|
|
|
gnutls
|
|
|
|
libqb
|
|
|
|
libuuid
|
|
|
|
libxml2.dev
|
|
|
|
libxslt.dev
|
|
|
|
pam
|
|
|
|
python3
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
./autogen.sh --prefix="$out"
|
|
|
|
'';
|
|
|
|
configureFlags = [
|
|
|
|
"--exec-prefix=${placeholder "out"}"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--with-initdir=/etc/systemd/system"
|
|
|
|
"--with-systemdsystemunitdir=/etc/systemd/system"
|
|
|
|
"--with-corosync"
|
|
|
|
# allows Type=notify in the systemd service
|
|
|
|
"--enable-systemd"
|
|
|
|
] ++ lib.optional (!forOCF) "--with-ocfdir=${ocf-resource-agents}/usr/lib/ocf";
|
|
|
|
|
|
|
|
installFlags = [ "DESTDIR=${placeholder "out"}" ];
|
|
|
|
|
2023-02-20 15:36:06 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
|
2021-02-24 17:36:49 +00:00
|
|
|
"-Wno-error=strict-prototypes"
|
2023-02-20 15:36:06 +00:00
|
|
|
]);
|
2021-02-24 17:36:49 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# pacemaker's install linking requires a weirdly nested hierarchy
|
|
|
|
mv $out$out/* $out
|
|
|
|
rm -r $out/nix
|
|
|
|
'';
|
|
|
|
|
2022-03-08 01:46:26 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) pacemaker;
|
|
|
|
};
|
|
|
|
|
2021-02-24 17:36:49 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://clusterlabs.org/pacemaker/";
|
|
|
|
description = "Pacemaker is an open source, high availability resource manager suitable for both small and large clusters.";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-03-08 01:46:26 +00:00
|
|
|
maintainers = with maintainers; [ ryantm astro ];
|
2021-02-24 17:36:49 +00:00
|
|
|
};
|
|
|
|
}
|