nixpkgs-suyu/pkgs/servers/corosync/default.nix

74 lines
2.1 KiB
Nix
Raw Normal View History

2019-03-03 01:18:13 +01:00
{ lib, stdenv, fetchurl, makeWrapper, pkg-config, kronosnet, nss, nspr, libqb
2019-12-21 23:44:50 +01:00
, dbus, rdma-core, libstatgrab, net-snmp
, enableDbus ? false
, enableInfiniBandRdma ? false
, enableMonitoring ? false
, enableSnmp ? false
2014-10-08 10:38:14 +02:00
}:
2021-01-15 08:07:56 +01:00
with lib;
2014-10-08 10:38:14 +02:00
stdenv.mkDerivation rec {
pname = "corosync";
2021-08-06 14:28:59 +02:00
version = "3.1.5";
2014-10-08 10:38:14 +02:00
src = fetchurl {
url = "http://build.clusterlabs.org/corosync/releases/${pname}-${version}.tar.gz";
2021-08-06 14:28:59 +02:00
sha256 = "sha256-O7o+PtgasrCAcRsu4kEC+7530GCwXUvi2jEAgghPC7w=";
2014-10-08 10:38:14 +02:00
};
nativeBuildInputs = [ makeWrapper pkg-config ];
2014-10-08 10:38:14 +02:00
buildInputs = [
2019-03-03 01:18:13 +01:00
kronosnet nss nspr libqb
] ++ optional enableDbus dbus
++ optional enableInfiniBandRdma rdma-core
++ optional enableMonitoring libstatgrab
2019-12-21 23:44:50 +01:00
++ optional enableSnmp net-snmp;
2014-10-08 10:38:14 +02:00
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
"--with-logdir=/var/log/corosync"
2014-10-08 10:38:14 +02:00
"--enable-watchdog"
"--enable-qdevices"
] ++ optional enableDbus "--enable-dbus"
++ optional enableInfiniBandRdma "--enable-rdma"
++ optional enableMonitoring "--enable-monitoring"
++ optional enableSnmp "--enable-snmp";
installFlags = [
"sysconfdir=$(out)/etc"
"localstatedir=$(out)/var"
"COROSYSCONFDIR=$(out)/etc/corosync"
"INITDDIR=$(out)/etc/init.d"
"LOGROTATEDIR=$(out)/etc/logrotate.d"
];
2014-10-08 10:38:14 +02:00
2019-03-03 01:18:13 +01:00
enableParallelBuilding = true;
preConfigure = optionalString enableInfiniBandRdma ''
# configure looks for the pkg-config files
# of librdmacm and libibverbs
# Howver, rmda-core does not provide a pkg-config file
# We give the flags manually here:
export rdmacm_LIBS=-lrdmacm
export rdmacm_CFLAGS=" "
export ibverbs_LIBS=-libverbs
export ibverbs_CFLAGS=" "
'';
2014-10-08 10:38:14 +02:00
postInstall = ''
wrapProgram $out/bin/corosync-blackbox \
--prefix PATH ":" "$out/sbin:${libqb}/sbin"
'';
meta = {
homepage = "http://corosync.org/";
2014-11-11 14:20:43 +01:00
description = "A Group Communication System with features for implementing high availability within applications";
2014-10-08 10:38:14 +02:00
license = licenses.bsd3;
2015-04-04 08:23:42 +02:00
platforms = platforms.linux;
2019-03-03 01:18:13 +01:00
maintainers = with maintainers; [ montag451 ryantm ];
2014-10-08 10:38:14 +02:00
};
}