depot/third_party/nixpkgs/pkgs/misc/ananicy-cpp/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01: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.1";
src = fetchFromGitLab {
owner = "ananicy-cpp";
repo = "ananicy-cpp";
rev = "v${version}";
fetchSubmodules = true;
sha256 = "sha256-oPinSc00+Z6SxjfTh7DttcXSjsLv1X0NI+O37C8M8GY=";
};
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 ];
mainProgram = "ananicy-cpp";
};
}