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";
|
|
|
|
})
|
2023-11-16 04:20:00 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "no_include_longintrepr.patch";
|
|
|
|
url = "https://github.com/collectd/collectd/commit/623e95394e0e62e7f9ced2104b786d21e9c0bf53.patch";
|
|
|
|
hash = "sha256-0eD7yNW3TWVyNMpLsADhYFDvy6COoCaI0kS1XJrwDgM=";
|
|
|
|
})
|
2021-12-24 04:21:11 +00:00
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
libtool
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2020-04-24 23:36:52 +00:00
|
|
|
darwin.apple_sdk.frameworks.ApplicationServices
|
|
|
|
] ++ plugins.buildInputs;
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--disable-werror"
|
2022-05-18 14:49:53 +00:00
|
|
|
] ++ plugins.configureFlags
|
|
|
|
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "--with-fp-layout=nothing" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# 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";
|
2024-05-15 15:35:15 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|