Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at litex 79 lines 2.3 kB view raw
1{ lib, stdenv, fetchurl, makeWrapper, pkg-config, kronosnet, nss, nspr, libqb 2, systemd, dbus, rdma-core, libstatgrab, net-snmp 3, enableDbus ? false 4, enableInfiniBandRdma ? false 5, enableMonitoring ? false 6, enableSnmp ? false 7}: 8 9with lib; 10 11stdenv.mkDerivation rec { 12 pname = "corosync"; 13 version = "3.1.7"; 14 15 src = fetchurl { 16 url = "http://build.clusterlabs.org/corosync/releases/${pname}-${version}.tar.gz"; 17 sha256 = "sha256-5lVrOjhZZfITMLk4Pc0XkPKKT3ngk5grQOouwj4KKfo="; 18 }; 19 20 nativeBuildInputs = [ makeWrapper pkg-config ]; 21 22 buildInputs = [ 23 kronosnet nss nspr libqb systemd.dev 24 ] ++ optional enableDbus dbus 25 ++ optional enableInfiniBandRdma rdma-core 26 ++ optional enableMonitoring libstatgrab 27 ++ optional enableSnmp net-snmp; 28 29 configureFlags = [ 30 "--sysconfdir=/etc" 31 "--localstatedir=/var" 32 "--with-logdir=/var/log/corosync" 33 "--enable-watchdog" 34 "--enable-qdevices" 35 # allows Type=notify in the systemd service 36 "--enable-systemd" 37 ] ++ optional enableDbus "--enable-dbus" 38 ++ optional enableInfiniBandRdma "--enable-rdma" 39 ++ optional enableMonitoring "--enable-monitoring" 40 ++ optional enableSnmp "--enable-snmp"; 41 42 installFlags = [ 43 "sysconfdir=$(out)/etc" 44 "localstatedir=$(out)/var" 45 "COROSYSCONFDIR=$(out)/etc/corosync" 46 "INITDDIR=$(out)/etc/init.d" 47 "LOGROTATEDIR=$(out)/etc/logrotate.d" 48 ]; 49 50 enableParallelBuilding = true; 51 52 preConfigure = optionalString enableInfiniBandRdma '' 53 # configure looks for the pkg-config files 54 # of librdmacm and libibverbs 55 # Howver, rmda-core does not provide a pkg-config file 56 # We give the flags manually here: 57 export rdmacm_LIBS=-lrdmacm 58 export rdmacm_CFLAGS=" " 59 export ibverbs_LIBS=-libverbs 60 export ibverbs_CFLAGS=" " 61 ''; 62 63 postInstall = '' 64 wrapProgram $out/bin/corosync-blackbox \ 65 --prefix PATH ":" "$out/sbin:${libqb}/sbin" 66 ''; 67 68 passthru.tests = { 69 inherit (nixosTests) pacemaker; 70 }; 71 72 meta = { 73 homepage = "http://corosync.org/"; 74 description = "A Group Communication System with features for implementing high availability within applications"; 75 license = licenses.bsd3; 76 platforms = platforms.linux; 77 maintainers = with maintainers; [ montag451 ryantm ]; 78 }; 79}