nixpkgs/pkgs/misc/ananicy-cpp/default.nix
Artturin 0a7693d9af ananicy-cpp: 1.0.2 -> 1.1.0
had to use clangStdenv because
/nix/store/1qa12idg59nlxjjdrw4hfyxdkhfd3nrq-clang-wrapper-11.1.0/bin/ar: CMakeFiles/ananicy_cpp_bpf_c.dir/src/bpf_program_utils.c.o: plugin needed to handle lto object
ananicy-cpp> /nix/store/1qa12idg59nlxjjdrw4hfyxdkhfd3nrq-clang-wrapper-11.1.0/bin/ranlib: libananicy_cpp_bpf_c.a(bpf_program_utils.c.o): plugin needed to handle lto object
ananicy-cpp> [100%] Linking CXX executable ananicy-cpp
ananicy-cpp> /nix/store/zsvpmlddl2i5mpzm031a99xfpn410m5b-binutils-2.40/bin/ld: /build/cchtSHrR.ltrans5.ltrans.o: in function `ProcessQueue::stop()':
ananicy-cpp> <artificial>:(.text+0x2274): undefined reference to `destroy_bpf_program'
ananicy-cpp> /nix/store/zsvpmlddl2i5mpzm031a99xfpn410m5b-binutils-2.40/bin/ld: /build/cchtSHrR.ltrans5.ltrans.o: in function `ProcessQueue::init()':
ananicy-cpp> <artificial>:(.text+0x8460): undefined reference to `initialize_bpf_program'
ananicy-cpp> /nix/store/zsvpmlddl2i5mpzm031a99xfpn410m5b-binutils-2.40/bin/ld: <artificial>:(.text+0x846c): undefined reference to `bpf_program_init_events'
ananicy-cpp> /nix/store/zsvpmlddl2i5mpzm031a99xfpn410m5b-binutils-2.40/bin/ld: <artificial>:(.text+0x8486): undefined reference to `destroy_bpf_program'
ananicy-cpp> /nix/store/zsvpmlddl2i5mpzm031a99xfpn410m5b-binutils-2.40/bin/ld: /build/cchtSHrR.ltrans5.ltrans.o: in function `std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<ProcessQueue::start()::{lambda(std::stop_token const&)#1}, std::stop_token> > >::_M_run() [clone .lto_priv.0]':
ananicy-cpp> <artificial>:(.text+0x861d): undefined reference to `destroy_bpf_program'
ananicy-cpp> collect2: error: ld returned 1 exit status
ananicy-cpp> make[2]: *** [CMakeFiles/ananicy-cpp.dir/build.make:325: ananicy-cpp] Error 1
ananicy-cpp> make[1]: *** [CMakeFiles/Makefile2💯 CMakeFiles/ananicy-cpp.dir/all] Error 2
ananicy-cpp> make: *** [Makefile:136: all] Error 2
2023-07-14 02:49:23 +03:00

70 lines
1.3 KiB
Nix

{ lib
, clangStdenv
, fetchFromGitLab
, cmake
, pkg-config
, spdlog
, nlohmann_json
, systemd
, libbpf
, elfutils
, bpftools
, zlib
}:
clangStdenv.mkDerivation rec {
pname = "ananicy-cpp";
version = "1.1.0";
src = fetchFromGitLab {
owner = "ananicy-cpp";
repo = "ananicy-cpp";
rev = "v${version}";
fetchSubmodules = true;
sha256 = "sha256-BomtP9KcipBJuZjra/ojRyJi+pgktxGGEdt86N1H9Hc=";
};
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
bpftools
];
buildInputs = [
spdlog
nlohmann_json
systemd
libbpf
elfutils
zlib
];
# BPF A call to built-in function '__stack_chk_fail' is not supported.
hardeningDisable = [ "stackprotector" ];
cmakeFlags = [
"-DUSE_EXTERNAL_JSON=ON"
"-DUSE_EXTERNAL_SPDLOG=ON"
"-DUSE_EXTERNAL_FMTLIB=ON"
"-DUSE_BPF_PROC_IMPL=ON"
"-DBPF_BUILD_LIBBPF=OFF"
"-DENABLE_SYSTEMD=ON"
"-DVERSION=${version}"
];
postInstall = ''
rm -rf "$out"/include
rm -rf "$out"/lib/cmake
'';
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 ];
};
}