Files
nixpkgs/pkgs/by-name/an/ananicy-cpp/package.nix
rebiz 2dc063cf76 ananicy-cpp: fix missing <cstring> and <cstdint> headers for glibc 2.42
glibc 2.42 tightened implicit header dependencies. Multiple source files use std:: types/functions that require explicit header includes which were previously pulled in transitively.

Fetches patch from upstream MR (ananicy-cpp!43).
2026-08-16 10:14:19 +05:30

98 lines
1.9 KiB
Nix

{
lib,
clangStdenv,
fetchFromGitLab,
fetchpatch,
cmake,
pkg-config,
spdlog,
nlohmann_json,
systemd,
libbpf,
elfutils,
bpftools,
pcre2,
zlib,
withBpf ? true,
}:
clangStdenv.mkDerivation (finalAttrs: {
pname = "ananicy-cpp";
version = "1.2.0";
src = fetchFromGitLab {
owner = "ananicy-cpp";
repo = "ananicy-cpp";
tag = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-Nl7Ugj5VPHwW85GJ44luUc2e95kFCanQhDRopGH9nTU=";
};
patches = [
./match-wrappers.patch
(fetchpatch {
name = "fix-cstring-include.patch";
url = "https://gitlab.com/ananicy-cpp/ananicy-cpp/-/merge_requests/43.diff";
hash = "sha256-drBUVh+N3KedJttzQIIA1s+38ngK9BgZFOdpxqBWV0E=";
})
];
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
]
++ lib.optionals withBpf [
bpftools
];
buildInputs = [
pcre2
spdlog
nlohmann_json
systemd
zlib
]
++ lib.optionals withBpf [
libbpf
elfutils
];
# BPF A call to built-in function '__stack_chk_fail' is not supported.
hardeningDisable = [
"stackprotector"
"zerocallusedregs"
];
cmakeFlags = [
(lib.mapAttrsToList lib.cmakeBool {
"USE_EXTERNAL_JSON" = true;
"USE_EXTERNAL_SPDLOG" = true;
"USE_EXTERNAL_FMTLIB" = true;
"USE_BPF_PROC_IMPL" = withBpf;
"BPF_BUILD_LIBBPF" = false;
"ENABLE_SYSTEMD" = true;
"ENABLE_REGEX_SUPPORT" = true;
})
(lib.cmakeFeature "VERSION" finalAttrs.version)
];
postInstall = ''
rm -rf "$out"/include
rm -rf "$out"/lib/cmake
'';
meta = {
homepage = "https://gitlab.com/ananicy-cpp/ananicy-cpp";
description = "Rewrite of ananicy in c++ for lower cpu and memory usage";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
artturin
johnrtitor
];
mainProgram = "ananicy-cpp";
};
})