Files
nixpkgs/pkgs/tools/system/collectd/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

94 lines
2.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
callPackage,
autoreconfHook,
pkg-config,
libtool,
bison,
flex,
perl,
nixosTests,
...
}@args:
let
plugins = callPackage ./plugins.nix args;
in
stdenv.mkDerivation (finalAttrs: {
pname = "collectd";
version = "5.12.0";
src = fetchFromGitHub {
owner = "collectd";
repo = "collectd";
tag = "collectd-${finalAttrs.version}";
hash = "sha256-UTlCY1GPRpbdQFLFUDjNr1PgEdGv4WNtjr8TYbxHK5A=";
};
# All of these are going to be included in the next release
patches = [
# fix -t never printing syntax errors
# should be included in next release
(fetchpatch {
name = "fix-broken-dash-t-option.patch";
url = "https://github.com/collectd/collectd/commit/3f575419e7ccb37a3b10ecc82adb2e83ff2826e1.patch";
hash = "sha256-XkDxLITmG0FLpgf8Ut1bDqulM4DmPs8Xrec2QB1tkks=";
})
(fetchpatch {
name = "no_include_longintrepr.patch";
url = "https://github.com/collectd/collectd/commit/623e95394e0e62e7f9ced2104b786d21e9c0bf53.patch";
hash = "sha256-0eD7yNW3TWVyNMpLsADhYFDvy6COoCaI0kS1XJrwDgM=";
})
];
nativeBuildInputs = [
pkg-config
autoreconfHook
bison
flex
perl # for pod2man
];
buildInputs = [
libtool
]
++ plugins.buildInputs;
configureFlags = [
"--localstatedir=/var"
"--disable-werror"
]
++ plugins.configureFlags
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "--with-fp-layout=nothing" ];
# Used in `src/virt.c`
env.NIX_CFLAGS_COMPILE = "-DATTRIBUTE_UNUSED=__attribute__((unused))";
# do not create directories in /var during installPhase
postConfigure = ''
substituteInPlace Makefile --replace-fail '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/' '#'
'';
postInstall = ''
if [ -d $out/share/collectd/java ]; then
mv $out/share/collectd/java $out/share/
fi
'';
enableParallelBuilding = true;
passthru.tests = {
inherit (nixosTests) collectd;
};
meta = {
description = "Daemon which collects system performance statistics periodically";
homepage = "https://collectd.org";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ bjornfor ];
};
})