From ee8a97a25e6aedb68e75ad11d60dcd923b37c680 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 8 Oct 2014 01:38:14 -0700 Subject: [PATCH] corosync: Add package --- pkgs/servers/corosync/default.nix | 50 +++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 52 insertions(+) create mode 100644 pkgs/servers/corosync/default.nix diff --git a/pkgs/servers/corosync/default.nix b/pkgs/servers/corosync/default.nix new file mode 100644 index 000000000000..cd87e0530554 --- /dev/null +++ b/pkgs/servers/corosync/default.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchurl, makeWrapper, pkgconfig, nss, nspr, libqb +, dbus ? null +, librdmacm ? null, libibverbs ? null +, libstatgrab ? null +, net_snmp ? null +}: + +with stdenv.lib; +stdenv.mkDerivation rec { + name = "corosync-2.3.4"; + + src = fetchurl { + url = "http://build.clusterlabs.org/corosync/releases/${name}.tar.gz"; + sha256 = "1m276b060fjghr93hdzfag81whi5ph65dc2ka8ln1igm3kxr7bix"; + }; + + buildInputs = [ + makeWrapper pkgconfig nss nspr libqb + dbus librdmacm libibverbs libstatgrab net_snmp + ]; + + # Remove when rdma libraries gain pkgconfig support + ibverbs_CFLAGS = optionalString (libibverbs != null) + "-I${libibverbs}/include/infiniband"; + ibverbs_LIBS = optionalString (libibverbs != null) "-libverbs"; + rdmacm_CFLAGS = optionalString (librdmacm != null) + "-I${librdmacm}/include/rdma"; + rdmacm_LIBS = optionalString (librdmacm != null) "-lrdmacm"; + + configureFlags = [ + "--enable-watchdog" + "--enable-qdevices" + ] ++ optional (dbus != null) "--enable-dbus" + ++ optional (librdmacm != null && libibverbs != null) "--enable-rdma" + ++ optional (libstatgrab != null) "--enable-monitoring" + ++ optional (net_snmp != null) "--enable-snmp"; + + postInstall = '' + wrapProgram $out/bin/corosync-blackbox \ + --prefix PATH ":" "$out/sbin:${libqb}/sbin" + ''; + + meta = { + homepage = http://corosync.org/; + description = "a Group Communication System with features for implementing high availability within applications."; + license = licenses.bsd3; + platforms = platforms.unix; + maintainers = with maintainers; [ wkennington ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fdb43ac0614d..31a156a0c677 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -649,6 +649,8 @@ let consul_ui = consul.ui; + corosync = callPackage ../servers/corosync { }; + chntpw = callPackage ../tools/security/chntpw { }; coprthr = callPackage ../development/libraries/coprthr {