1 { lib, stdenv, fetchurl, makeWrapper, pkg-config, kronosnet, nss, nspr, libqb
2 , systemd, dbus, rdma-core, libstatgrab, net-snmp
4 , enableInfiniBandRdma ? false
5 , enableMonitoring ? false
12 stdenv.mkDerivation rec {
17 url = "http://build.clusterlabs.org/corosync/releases/${pname}-${version}.tar.gz";
18 sha256 = "sha256-cCNUT6O7NsALvKvZk1tyabQdiWc4oQjtMuqbnJsn7D0=";
21 nativeBuildInputs = [ makeWrapper pkg-config ];
24 kronosnet nss nspr libqb systemd.dev
25 ] ++ optional enableDbus dbus
26 ++ optional enableInfiniBandRdma rdma-core
27 ++ optional enableMonitoring libstatgrab
28 ++ optional enableSnmp net-snmp;
32 "--localstatedir=/var"
33 "--with-logdir=/var/log/corosync"
36 # allows Type=notify in the systemd service
38 ] ++ optional enableDbus "--enable-dbus"
39 ++ optional enableInfiniBandRdma "--enable-rdma"
40 ++ optional enableMonitoring "--enable-monitoring"
41 ++ optional enableSnmp "--enable-snmp";
44 "sysconfdir=$(out)/etc"
45 "localstatedir=$(out)/var"
46 "COROSYSCONFDIR=$(out)/etc/corosync"
47 "INITDDIR=$(out)/etc/init.d"
48 "LOGROTATEDIR=$(out)/etc/logrotate.d"
51 enableParallelBuilding = true;
53 preConfigure = optionalString enableInfiniBandRdma ''
54 # configure looks for the pkg-config files
55 # of librdmacm and libibverbs
56 # Howver, rmda-core does not provide a pkg-config file
57 # We give the flags manually here:
58 export rdmacm_LIBS=-lrdmacm
59 export rdmacm_CFLAGS=" "
60 export ibverbs_LIBS=-libverbs
61 export ibverbs_CFLAGS=" "
65 wrapProgram $out/bin/corosync-blackbox \
66 --prefix PATH ":" "$out/sbin:${libqb}/sbin"
70 inherit (nixosTests) pacemaker;
74 homepage = "http://corosync.org/";
75 description = "Group Communication System with features for implementing high availability within applications";
76 license = licenses.bsd3;
77 platforms = platforms.linux;
78 maintainers = with maintainers; [ montag451 ryantm ];