2019-07-03 10:49:29 +00:00
|
|
|
{ stdenv, fetchurl, autoreconfHook, pkgconfig
|
|
|
|
, CoreFoundation, IOKit, libossp_uuid
|
|
|
|
, curl, libcap, libuuid, lm_sensors, zlib
|
|
|
|
, withCups ? false, cups
|
|
|
|
, withDBengine ? true, libuv, lz4, judy
|
|
|
|
, withIpmi ? (!stdenv.isDarwin), freeipmi
|
|
|
|
, withNetfilter ? (!stdenv.isDarwin), libmnl, libnetfilter_acct
|
|
|
|
, withSsl ? true, openssl
|
|
|
|
}:
|
2016-04-14 21:43:01 +00:00
|
|
|
|
2019-07-03 10:49:29 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-06-26 17:38:01 +00:00
|
|
|
version = "1.15.0";
|
2016-04-14 21:43:01 +00:00
|
|
|
name = "netdata-${version}";
|
|
|
|
|
2018-11-14 16:01:41 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/netdata/netdata/releases/download/v${version}/netdata-v${version}.tar.gz";
|
2019-06-26 17:38:01 +00:00
|
|
|
sha256 = "04frfy08k6m70y3s8j3gvnfnqqd9d5mwj3j6krk9dsh34332abvx";
|
2016-04-14 21:43:01 +00:00
|
|
|
};
|
|
|
|
|
2017-09-05 21:26:13 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
2019-07-03 10:49:29 +00:00
|
|
|
buildInputs = [ curl.dev zlib.dev ]
|
|
|
|
++ optionals stdenv.isDarwin [ CoreFoundation IOKit libossp_uuid ]
|
|
|
|
++ optionals (!stdenv.isDarwin) [ libcap.dev libuuid.dev ]
|
|
|
|
++ optionals withCups [ cups ]
|
|
|
|
++ optionals withDBengine [ libuv lz4.dev judy ]
|
|
|
|
++ optionals withIpmi [ freeipmi ]
|
|
|
|
++ optionals withNetfilter [ libmnl libnetfilter_acct ]
|
|
|
|
++ optionals withSsl [ openssl.dev ];
|
2016-04-14 21:43:01 +00:00
|
|
|
|
2018-10-12 08:53:36 +00:00
|
|
|
patches = [
|
|
|
|
./no-files-in-etc-and-var.patch
|
|
|
|
];
|
2016-10-25 14:23:19 +00:00
|
|
|
|
2019-07-03 10:49:29 +00:00
|
|
|
postInstall = optionalString (!stdenv.isDarwin) ''
|
2018-10-12 08:57:45 +00:00
|
|
|
# rename this plugin so netdata will look for setuid wrapper
|
|
|
|
mv $out/libexec/netdata/plugins.d/apps.plugin \
|
2019-06-26 17:38:01 +00:00
|
|
|
$out/libexec/netdata/plugins.d/apps.plugin.org
|
2019-07-04 09:09:54 +00:00
|
|
|
${optionalString withIpmi ''
|
|
|
|
mv $out/libexec/netdata/plugins.d/freeipmi.plugin \
|
|
|
|
$out/libexec/netdata/plugins.d/freeipmi.plugin.org
|
|
|
|
''}
|
2018-10-12 08:57:45 +00:00
|
|
|
'';
|
|
|
|
|
2019-07-03 10:49:29 +00:00
|
|
|
preConfigure = optionalString (!stdenv.isDarwin) ''
|
2019-03-07 21:01:48 +00:00
|
|
|
substituteInPlace collectors/python.d.plugin/python_modules/third_party/lm_sensors.py \
|
|
|
|
--replace 'ctypes.util.find_library("sensors")' '"${lm_sensors.out}/lib/libsensors${stdenv.hostPlatform.extensions.sharedLibrary}"'
|
|
|
|
'';
|
|
|
|
|
2016-10-25 14:23:19 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
2018-10-12 08:53:36 +00:00
|
|
|
"--sysconfdir=/etc"
|
2016-10-25 14:23:19 +00:00
|
|
|
];
|
|
|
|
|
2018-11-14 16:01:41 +00:00
|
|
|
postFixup = ''
|
|
|
|
rm -r $out/sbin
|
2016-10-14 10:05:42 +00:00
|
|
|
'';
|
2016-04-17 09:15:59 +00:00
|
|
|
|
2019-07-03 10:49:29 +00:00
|
|
|
meta = {
|
2016-04-14 21:43:01 +00:00
|
|
|
description = "Real-time performance monitoring tool";
|
2018-11-14 16:01:41 +00:00
|
|
|
homepage = https://my-netdata.io/;
|
2016-04-14 21:43:01 +00:00
|
|
|
license = licenses.gpl3;
|
2018-11-14 16:01:41 +00:00
|
|
|
platforms = platforms.unix;
|
2016-04-14 21:43:01 +00:00
|
|
|
maintainers = [ maintainers.lethalman ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|