summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorRyan Mulligan <ryan@ryantm.com>2021-02-24 09:36:49 -0800
committerAstro <astro@spaceboyz.net>2022-03-08 20:26:52 +0100
commit2b78cfdb097dfb68bcfcae532de303475ae1a030 (patch)
tree94e7f771d9cfd03060d2712415859751b49e8df8 /pkgs/misc
parent1e6453bb4475a3699ff18ce55c5d9822d93c8b96 (diff)
downloadnixpkgs-2b78cfdb097dfb68bcfcae532de303475ae1a030.tar
nixpkgs-2b78cfdb097dfb68bcfcae532de303475ae1a030.tar.gz
nixpkgs-2b78cfdb097dfb68bcfcae532de303475ae1a030.tar.bz2
nixpkgs-2b78cfdb097dfb68bcfcae532de303475ae1a030.tar.lz
nixpkgs-2b78cfdb097dfb68bcfcae532de303475ae1a030.tar.xz
nixpkgs-2b78cfdb097dfb68bcfcae532de303475ae1a030.tar.zst
nixpkgs-2b78cfdb097dfb68bcfcae532de303475ae1a030.zip
pacemaker: init at 2.1.2
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/logging/pacemaker/default.nix97
1 files changed, 97 insertions, 0 deletions
diff --git a/pkgs/misc/logging/pacemaker/default.nix b/pkgs/misc/logging/pacemaker/default.nix
new file mode 100644
index 00000000000..7277ae091e7
--- /dev/null
+++ b/pkgs/misc/logging/pacemaker/default.nix
@@ -0,0 +1,97 @@
+{ 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.2";
+
+  src = fetchFromGitHub {
+    owner = "ClusterLabs";
+    repo = pname;
+    rev = "Pacemaker-${version}";
+    sha256 = "1w7vq3lmgcz38pfww9vccm142vjsjqz3qc9nnk09ynkx4agqhxdg";
+  };
+
+  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"}" ];
+
+  NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
+    "-Wno-error=strict-prototypes"
+  ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    # pacemaker's install linking requires a weirdly nested hierarchy
+    mv $out$out/* $out
+    rm -r $out/nix
+  '';
+
+  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 ];
+  };
+}