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