2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, darwin, callPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
, autoreconfHook
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, libtool
|
2021-12-24 04:21:11 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
, ...
|
|
|
|
}@args:
|
|
|
|
let
|
|
|
|
plugins = callPackage ./plugins.nix args;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-09-25 04:45:31 +00:00
|
|
|
version = "5.12.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "collectd";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://collectd.org/files/${pname}-${version}.tar.bz2";
|
2020-09-25 04:45:31 +00:00
|
|
|
sha256 = "1mh97afgq6qgmpvpr84zngh58m0sl1b4wimqgvvk376188q09bjv";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
patches = [
|
|
|
|
# fix -t never printing syntax errors
|
|
|
|
# should be included in next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/collectd/collectd/commit/3f575419e7ccb37a3b10ecc82adb2e83ff2826e1.patch";
|
|
|
|
sha256 = "0jwjdlfl0dp7mlbwygp6h0rsbaqfbgfm5z07lr5l26z6hhng2h2y";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
libtool
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2020-04-24 23:36:52 +00:00
|
|
|
darwin.apple_sdk.frameworks.ApplicationServices
|
|
|
|
] ++ plugins.buildInputs;
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--disable-werror"
|
|
|
|
] ++ plugins.configureFlags;
|
|
|
|
|
|
|
|
# do not create directories in /var during installPhase
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace Makefile --replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/' '#'
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
if [ -d $out/share/collectd/java ]; then
|
|
|
|
mv $out/share/collectd/java $out/share/
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) collectd;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Daemon which collects system performance statistics periodically";
|
|
|
|
homepage = "https://collectd.org";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ bjornfor fpletz ];
|
|
|
|
};
|
|
|
|
}
|