netdata: update build options, build with jemalloc (#179848)

This commit is contained in:
Yurii Izorkin 2022-07-12 16:00:48 +03:00 committed by GitHub
parent 59f11eb3cf
commit 2b7a01a6ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,12 +1,15 @@
{ lib, stdenv, callPackage, fetchFromGitHub, autoreconfHook, pkg-config, makeWrapper { lib, stdenv, callPackage, fetchFromGitHub, autoreconfHook, pkg-config, makeWrapper
, CoreFoundation, IOKit, libossp_uuid , CoreFoundation, IOKit, libossp_uuid
, nixosTests , nixosTests
, curl, libcap, libuuid, lm_sensors, zlib, protobuf , curl, jemalloc, libuv, zlib
, libcap, libuuid, lm_sensors, protobuf
, withCups ? false, cups , withCups ? false, cups
, withDBengine ? true, libuv, lz4, judy , withDBengine ? true, judy, lz4
, withIpmi ? (!stdenv.isDarwin), freeipmi , withIpmi ? (!stdenv.isDarwin), freeipmi
, withNetfilter ? (!stdenv.isDarwin), libmnl, libnetfilter_acct , withNetfilter ? (!stdenv.isDarwin), libmnl, libnetfilter_acct
, withCloud ? (!stdenv.isDarwin), json_c , withCloud ? (!stdenv.isDarwin), json_c
, withConnPubSub ? false, google-cloud-cpp, grpc
, withConnPrometheus ? false, snappy
, withSsl ? true, openssl , withSsl ? true, openssl
, withDebug ? false , withDebug ? false
}: }:
@ -30,14 +33,17 @@ in stdenv.mkDerivation rec {
strictDeps = true; strictDeps = true;
nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper protobuf ]; nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper protobuf ];
buildInputs = [ curl.dev zlib.dev protobuf ] buildInputs = [ curl.dev jemalloc libuv zlib.dev ]
++ optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ] ++ optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ]
++ optionals (!stdenv.isDarwin) [ libcap.dev libuuid.dev ] ++ optionals (!stdenv.isDarwin) [ libcap.dev libuuid.dev ]
++ optionals withCups [ cups ] ++ optionals withCups [ cups ]
++ optionals withDBengine [ libuv lz4.dev judy ] ++ optionals withDBengine [ judy lz4.dev ]
++ optionals withIpmi [ freeipmi ] ++ optionals withIpmi [ freeipmi ]
++ optionals withNetfilter [ libmnl libnetfilter_acct ] ++ optionals withNetfilter [ libmnl libnetfilter_acct ]
++ optionals withCloud [ json_c ] ++ optionals withCloud [ json_c ]
++ optionals withConnPubSub [ google-cloud-cpp grpc ]
++ optionals withConnPrometheus [ snappy ]
++ optionals (withCloud || withConnPrometheus) [ protobuf ]
++ optionals withSsl [ openssl.dev ]; ++ optionals withSsl [ openssl.dev ];
patches = [ patches = [
@ -92,9 +98,11 @@ in stdenv.mkDerivation rec {
"--localstatedir=/var" "--localstatedir=/var"
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--disable-ebpf" "--disable-ebpf"
] ++ optionals withCloud [ "--with-jemalloc=${jemalloc}"
"--enable-cloud" ] ++ optional (!withDBengine) [
"--with-aclk-ng" "--disable-dbengine"
] ++ optional (!withCloud) [
"--disable-cloud"
]; ];
postFixup = '' postFixup = ''