1{ lib
2, clangStdenv
3, fetchFromGitLab
4, cmake
5, pkg-config
6, spdlog
7, nlohmann_json
8, systemd
9, libbpf
10, elfutils
11, bpftools
12, zlib
13}:
14
15clangStdenv.mkDerivation rec {
16 pname = "ananicy-cpp";
17 version = "1.1.1";
18
19 src = fetchFromGitLab {
20 owner = "ananicy-cpp";
21 repo = "ananicy-cpp";
22 rev = "v${version}";
23 fetchSubmodules = true;
24 sha256 = "sha256-oPinSc00+Z6SxjfTh7DttcXSjsLv1X0NI+O37C8M8GY=";
25 };
26
27 strictDeps = true;
28
29 nativeBuildInputs = [
30 cmake
31 pkg-config
32 bpftools
33 ];
34
35 buildInputs = [
36 spdlog
37 nlohmann_json
38 systemd
39 libbpf
40 elfutils
41 zlib
42 ];
43
44 # BPF A call to built-in function '__stack_chk_fail' is not supported.
45 hardeningDisable = [ "stackprotector" ];
46
47 cmakeFlags = [
48 "-DUSE_EXTERNAL_JSON=ON"
49 "-DUSE_EXTERNAL_SPDLOG=ON"
50 "-DUSE_EXTERNAL_FMTLIB=ON"
51 "-DUSE_BPF_PROC_IMPL=ON"
52 "-DBPF_BUILD_LIBBPF=OFF"
53 "-DENABLE_SYSTEMD=ON"
54 "-DVERSION=${version}"
55 ];
56
57 postInstall = ''
58 rm -rf "$out"/include
59 rm -rf "$out"/lib/cmake
60 '';
61
62 meta = with lib; {
63 homepage = "https://gitlab.com/ananicy-cpp/ananicy-cpp";
64 description = "Rewrite of ananicy in c++ for lower cpu and memory usage";
65 license = licenses.gpl3Only;
66 platforms = platforms.linux;
67 maintainers = with maintainers; [ artturin ];
68 };
69}