summary refs log tree commit diff
path: root/pkgs/servers/corosync/default.nix
blob: f4ceca5f386d2ee5a29ec6c4781c7276b28e59a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 ];
  };
}