{ lib , stdenv , autoconf , automake , bash , bzip2 , corosync , dbus , fetchFromGitHub , glib , gnutls , libqb , libtool , libuuid , libxml2 , libxslt , pam , pkg-config , python3 # 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"; version = "2.1.1"; src = fetchFromGitHub { owner = "ClusterLabs"; repo = pname; rev = "Pacemaker-${version}"; sha256 = "0grzw3yv6l8l83pi0pdn1fps3qh7hk3fl2xbv3vx1ixri29m3438"; }; 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"; configureFlags = [ "--exec-prefix=${placeholder "out"}" "--sysconfdir=/etc" "--datadir=/var/lib" "--localstatedir=/var" "--enable-systemd" "--with-systemdsystemunitdir=/etc/systemd/system" "--with-corosync" ] ++ lib.optional (!forOCF) "--with-ocfdir=${ocf-resource-agents}/usr/lib/ocf"; installFlags = [ "DESTDIR=${placeholder "out"}" ]; NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-Wno-error=strict-prototypes" ]; enableParallelBuilding = true; postInstall = '' mv $out$out/* $out rm -r $out/nix ln -sf /var/lib/pacemaker/cib $out/var/lib/pacemaker/cib ''; 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; maintainers = with maintainers; [ ryantm ]; }; }