2021-11-08 16:31:01 +01:00
|
|
|
{ lib
|
2023-07-08 21:25:46 +02:00
|
|
|
, clangStdenv
|
2021-11-08 16:31:01 +01:00
|
|
|
, fetchFromGitLab
|
|
|
|
, cmake
|
2022-11-22 23:20:33 +01:00
|
|
|
, pkg-config
|
2021-11-08 16:31:01 +01:00
|
|
|
, spdlog
|
|
|
|
, nlohmann_json
|
|
|
|
, systemd
|
2023-07-08 21:25:46 +02:00
|
|
|
, libbpf
|
|
|
|
, elfutils
|
|
|
|
, bpftools
|
|
|
|
, zlib
|
2021-11-08 16:31:01 +01:00
|
|
|
}:
|
|
|
|
|
2023-07-08 21:25:46 +02:00
|
|
|
clangStdenv.mkDerivation rec {
|
2021-11-08 16:31:01 +01:00
|
|
|
pname = "ananicy-cpp";
|
2023-07-08 21:25:46 +02:00
|
|
|
version = "1.1.0";
|
2021-11-08 16:31:01 +01:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "ananicy-cpp";
|
|
|
|
repo = "ananicy-cpp";
|
2022-11-22 23:20:33 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-07-08 21:25:46 +02:00
|
|
|
sha256 = "sha256-BomtP9KcipBJuZjra/ojRyJi+pgktxGGEdt86N1H9Hc=";
|
2021-11-08 16:31:01 +01:00
|
|
|
};
|
|
|
|
|
2023-07-08 21:25:46 +02:00
|
|
|
strictDeps = true;
|
|
|
|
|
2021-11-08 16:31:01 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-11-22 23:20:33 +01:00
|
|
|
pkg-config
|
2023-07-08 21:25:46 +02:00
|
|
|
bpftools
|
2021-11-08 16:31:01 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
spdlog
|
|
|
|
nlohmann_json
|
|
|
|
systemd
|
2023-07-08 21:25:46 +02:00
|
|
|
libbpf
|
|
|
|
elfutils
|
|
|
|
zlib
|
2021-11-08 16:31:01 +01:00
|
|
|
];
|
|
|
|
|
2023-07-08 21:25:46 +02:00
|
|
|
# BPF A call to built-in function '__stack_chk_fail' is not supported.
|
|
|
|
hardeningDisable = [ "stackprotector" ];
|
|
|
|
|
2021-11-08 16:31:01 +01:00
|
|
|
cmakeFlags = [
|
2022-11-22 23:20:33 +01:00
|
|
|
"-DUSE_EXTERNAL_JSON=ON"
|
2021-11-08 16:31:01 +01:00
|
|
|
"-DUSE_EXTERNAL_SPDLOG=ON"
|
|
|
|
"-DUSE_EXTERNAL_FMTLIB=ON"
|
2023-07-08 21:25:46 +02:00
|
|
|
"-DUSE_BPF_PROC_IMPL=ON"
|
|
|
|
"-DBPF_BUILD_LIBBPF=OFF"
|
|
|
|
"-DENABLE_SYSTEMD=ON"
|
2022-11-22 23:20:33 +01:00
|
|
|
"-DVERSION=${version}"
|
2021-11-08 16:31:01 +01:00
|
|
|
];
|
|
|
|
|
2022-11-22 23:20:33 +01:00
|
|
|
postInstall = ''
|
|
|
|
rm -rf "$out"/include
|
|
|
|
rm -rf "$out"/lib/cmake
|
|
|
|
'';
|
|
|
|
|
2021-11-08 16:31:01 +01:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://gitlab.com/ananicy-cpp/ananicy-cpp";
|
|
|
|
description = "Rewrite of ananicy in c++ for lower cpu and memory usage";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ artturin ];
|
|
|
|
};
|
|
|
|
}
|