nixpkgs/pkgs/servers/corosync/default.nix
Jonathan Ringer 9bb3fccb5b treewide: pkgs.pkgconfig -> pkgs.pkg-config, move pkgconfig to alias.nix
continuation of #109595

pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.

python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
2021-01-19 01:16:25 -08:00

74 lines
2.0 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, pkg-config, nss, nspr, libqb
, dbus, rdma-core, libstatgrab, net-snmp
, enableDbus ? false
, enableInfiniBandRdma ? false
, enableMonitoring ? false
, enableSnmp ? false
}:
with lib;
stdenv.mkDerivation rec {
pname = "corosync";
version = "2.4.5";
src = fetchurl {
url = "http://build.clusterlabs.org/corosync/releases/${pname}-${version}.tar.gz";
sha256 = "0pxs18vci9kq3qnqsg5i1h35jrxxiccwbm0mzja3g8j3izdsyvmb";
};
nativeBuildInputs = [ makeWrapper pkg-config ];
buildInputs = [
nss nspr libqb
] ++ optional enableDbus dbus
++ optional enableInfiniBandRdma rdma-core
++ optional enableMonitoring libstatgrab
++ optional enableSnmp net-snmp;
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
"--with-logdir=/var/log/corosync"
"--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"
];
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=" "
'';
postInstall = ''
wrapProgram $out/bin/corosync-blackbox \
--prefix PATH ":" "$out/sbin:${libqb}/sbin"
'';
enableParallelBuilding = true;
meta = {
homepage = "http://corosync.org/";
description = "A Group Communication System with features for implementing high availability within applications";
license = licenses.bsd3;
platforms = platforms.linux;
maintainers = with maintainers; [ montag451 ];
};
}