2019-03-03 00:18:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, pkg-config, kronosnet, nss, nspr, libqb
|
2022-03-02 19:46:04 +00:00
|
|
|
, systemd, dbus, rdma-core, libstatgrab, net-snmp
|
2016-11-28 07:15:56 +00:00
|
|
|
, enableDbus ? false
|
|
|
|
, enableInfiniBandRdma ? false
|
|
|
|
, enableMonitoring ? false
|
|
|
|
, enableSnmp ? false
|
2014-10-08 08:38:14 +00:00
|
|
|
}:
|
|
|
|
|
2021-01-15 07:07:56 +00:00
|
|
|
with lib;
|
2016-11-28 07:15:56 +00:00
|
|
|
|
2014-10-08 08:38:14 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-11-25 04:07:13 +00:00
|
|
|
pname = "corosync";
|
2022-11-18 08:12:36 +00:00
|
|
|
version = "3.1.7";
|
2014-10-08 08:38:14 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-11-25 04:07:13 +00:00
|
|
|
url = "http://build.clusterlabs.org/corosync/releases/${pname}-${version}.tar.gz";
|
2022-11-18 08:12:36 +00:00
|
|
|
sha256 = "sha256-5lVrOjhZZfITMLk4Pc0XkPKKT3ngk5grQOouwj4KKfo=";
|
2014-10-08 08:38:14 +00:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper pkg-config ];
|
2014-10-08 08:38:14 +00:00
|
|
|
|
2016-11-28 07:15:56 +00:00
|
|
|
buildInputs = [
|
2022-03-02 19:46:04 +00:00
|
|
|
kronosnet nss nspr libqb systemd.dev
|
2016-11-28 07:15:56 +00:00
|
|
|
] ++ optional enableDbus dbus
|
2018-10-21 20:49:04 +00:00
|
|
|
++ optional enableInfiniBandRdma rdma-core
|
2016-11-28 07:15:56 +00:00
|
|
|
++ optional enableMonitoring libstatgrab
|
2019-12-21 22:44:50 +00:00
|
|
|
++ optional enableSnmp net-snmp;
|
2014-10-08 08:38:14 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2016-11-28 07:15:56 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--with-logdir=/var/log/corosync"
|
2014-10-08 08:38:14 +00:00
|
|
|
"--enable-watchdog"
|
|
|
|
"--enable-qdevices"
|
2022-03-02 19:46:04 +00:00
|
|
|
# allows Type=notify in the systemd service
|
|
|
|
"--enable-systemd"
|
2016-11-28 07:15:56 +00:00
|
|
|
] ++ 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 08:38:14 +00:00
|
|
|
|
2019-03-03 00:18:13 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-10-21 20:49:04 +00:00
|
|
|
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 08:38:14 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/corosync-blackbox \
|
|
|
|
--prefix PATH ":" "$out/sbin:${libqb}/sbin"
|
|
|
|
'';
|
|
|
|
|
2022-03-08 01:46:26 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) pacemaker;
|
|
|
|
};
|
|
|
|
|
2014-10-08 08:38:14 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://corosync.org/";
|
2014-11-11 13:20:43 +00:00
|
|
|
description = "A Group Communication System with features for implementing high availability within applications";
|
2014-10-08 08:38:14 +00:00
|
|
|
license = licenses.bsd3;
|
2015-04-04 06:23:42 +00:00
|
|
|
platforms = platforms.linux;
|
2019-03-03 00:18:13 +00:00
|
|
|
maintainers = with maintainers; [ montag451 ryantm ];
|
2014-10-08 08:38:14 +00:00
|
|
|
};
|
|
|
|
}
|