uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
117
pkgs/tools/system/netdata/default.nix
Normal file
117
pkgs/tools/system/netdata/default.nix
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
{ lib, stdenv, callPackage, fetchFromGitHub, autoreconfHook, pkg-config, makeWrapper
|
||||
, CoreFoundation, IOKit, libossp_uuid
|
||||
, nixosTests
|
||||
, curl, libcap, libuuid, lm_sensors, zlib, protobuf
|
||||
, withCups ? false, cups
|
||||
, withDBengine ? true, libuv, lz4, judy
|
||||
, withIpmi ? (!stdenv.isDarwin), freeipmi
|
||||
, withNetfilter ? (!stdenv.isDarwin), libmnl, libnetfilter_acct
|
||||
, withCloud ? (!stdenv.isDarwin), json_c
|
||||
, withSsl ? true, openssl
|
||||
, withDebug ? false
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
go-d-plugin = callPackage ./go.d.plugin.nix {};
|
||||
in stdenv.mkDerivation rec {
|
||||
version = "1.34.1";
|
||||
pname = "netdata";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "netdata";
|
||||
repo = "netdata";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-MGXHIbmoPRyjjYHV/RD9sd8Dn74YVlET2V3d/wJ3blo=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper protobuf ];
|
||||
buildInputs = [ curl.dev zlib.dev protobuf ]
|
||||
++ 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 withCloud [ json_c ]
|
||||
++ optionals withSsl [ openssl.dev ];
|
||||
|
||||
patches = [
|
||||
# required to prevent plugins from relying on /etc
|
||||
# and /var
|
||||
./no-files-in-etc-and-var.patch
|
||||
# The current IPC location is unsafe as it writes
|
||||
# a fixed path in /tmp, which is world-writable.
|
||||
# Therefore we put it into `/run/netdata`, which is owned
|
||||
# by netdata only.
|
||||
./ipc-socket-in-run.patch
|
||||
|
||||
# Avoid build-only inputs in closure leaked by configure command:
|
||||
# https://github.com/NixOS/nixpkgs/issues/175693#issuecomment-1143344162
|
||||
./skip-CONFIGURE_COMMAND.patch
|
||||
];
|
||||
|
||||
# Guard against unused buld-time development inputs in closure. Without
|
||||
# the ./skip-CONFIGURE_COMMAND.patch patch the closure retains inputs up
|
||||
# to bootstrap tools:
|
||||
# https://github.com/NixOS/nixpkgs/pull/175719
|
||||
# We pick zlib.dev as a simple canary package with pkg-config input.
|
||||
disallowedReferences = [ zlib.dev ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = optionalString withDebug "-O1 -ggdb -DNETDATA_INTERNAL_CHECKS=1";
|
||||
|
||||
postInstall = ''
|
||||
ln -s ${go-d-plugin}/lib/netdata/conf.d/* $out/lib/netdata/conf.d
|
||||
ln -s ${go-d-plugin}/bin/godplugin $out/libexec/netdata/plugins.d/go.d.plugin
|
||||
'' + optionalString (!stdenv.isDarwin) ''
|
||||
# rename this plugin so netdata will look for setuid wrapper
|
||||
mv $out/libexec/netdata/plugins.d/apps.plugin \
|
||||
$out/libexec/netdata/plugins.d/apps.plugin.org
|
||||
mv $out/libexec/netdata/plugins.d/cgroup-network \
|
||||
$out/libexec/netdata/plugins.d/cgroup-network.org
|
||||
mv $out/libexec/netdata/plugins.d/perf.plugin \
|
||||
$out/libexec/netdata/plugins.d/perf.plugin.org
|
||||
mv $out/libexec/netdata/plugins.d/slabinfo.plugin \
|
||||
$out/libexec/netdata/plugins.d/slabinfo.plugin.org
|
||||
${optionalString withIpmi ''
|
||||
mv $out/libexec/netdata/plugins.d/freeipmi.plugin \
|
||||
$out/libexec/netdata/plugins.d/freeipmi.plugin.org
|
||||
''}
|
||||
'';
|
||||
|
||||
preConfigure = optionalString (!stdenv.isDarwin) ''
|
||||
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}"'
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--localstatedir=/var"
|
||||
"--sysconfdir=/etc"
|
||||
"--disable-ebpf"
|
||||
] ++ optionals withCloud [
|
||||
"--enable-cloud"
|
||||
"--with-aclk-ng"
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/netdata-claim.sh --prefix PATH : ${lib.makeBinPath [ openssl ]}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit withIpmi;
|
||||
tests.netdata = nixosTests.netdata;
|
||||
};
|
||||
|
||||
meta = {
|
||||
broken = stdenv.isDarwin;
|
||||
description = "Real-time performance monitoring tool";
|
||||
homepage = "https://www.netdata.cloud/";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.unix;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
31
pkgs/tools/system/netdata/go.d.plugin.nix
Normal file
31
pkgs/tools/system/netdata/go.d.plugin.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ lib, fetchFromGitHub, buildGoModule }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "netdata-go.d.plugin";
|
||||
version = "0.32.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "netdata";
|
||||
repo = "go.d.plugin";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-SayFqr6n6OLLUXseYiR8iBIf2xeDEHXHD0qBrgHY6+o=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-tIuHWfAjvr5s2nJSnhnMZIjyy77BbobwgQoDOy4gdGI=";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/lib/netdata/conf.d
|
||||
cp -r config/* $out/lib/netdata/conf.d
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Netdata orchestrator for data collection modules written in go";
|
||||
homepage = "https://github.com/netdata/go.d.plugin";
|
||||
license = licenses.gpl3;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
13
pkgs/tools/system/netdata/ipc-socket-in-run.patch
Normal file
13
pkgs/tools/system/netdata/ipc-socket-in-run.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/daemon/commands.h b/daemon/commands.h
|
||||
index bd4aabfe1cbe4..ce7eb3c730228 100644
|
||||
--- a/daemon/commands.h
|
||||
+++ b/daemon/commands.h
|
||||
@@ -6,7 +6,7 @@
|
||||
#ifdef _WIN32
|
||||
# define PIPENAME "\\\\?\\pipe\\netdata-cli"
|
||||
#else
|
||||
-# define PIPENAME "/tmp/netdata-ipc"
|
||||
+# define PIPENAME "/run/netdata/ipc"
|
||||
#endif
|
||||
|
||||
#define MAX_COMMAND_LENGTH 4096
|
||||
131
pkgs/tools/system/netdata/no-files-in-etc-and-var.patch
Normal file
131
pkgs/tools/system/netdata/no-files-in-etc-and-var.patch
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
diff --git a/collectors/Makefile.am b/collectors/Makefile.am
|
||||
index 021e2ff23..115b88277 100644
|
||||
--- a/collectors/Makefile.am
|
||||
+++ b/collectors/Makefile.am
|
||||
@@ -33,7 +33,7 @@ usercustompluginsconfigdir=$(configdir)/custom-plugins.d
|
||||
usergoconfigdir=$(configdir)/go.d
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(usercustompluginsconfigdir)
|
||||
$(INSTALL) -d $(DESTDIR)$(usergoconfigdir)
|
||||
|
||||
diff --git a/collectors/charts.d.plugin/Makefile.am b/collectors/charts.d.plugin/Makefile.am
|
||||
index 03c7f0a94..01985db01 100644
|
||||
--- a/collectors/charts.d.plugin/Makefile.am
|
||||
+++ b/collectors/charts.d.plugin/Makefile.am
|
||||
@@ -34,7 +34,7 @@ dist_userchartsconfig_DATA = \
|
||||
$(NULL)
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(userchartsconfigdir)
|
||||
|
||||
chartsconfigdir=$(libconfigdir)/charts.d
|
||||
diff --git a/collectors/ebpf.plugin/Makefile.am b/collectors/ebpf.plugin/Makefile.am
|
||||
index 2d5f92a6b..8b11c7502 100644
|
||||
--- a/collectors/ebpf.plugin/Makefile.am
|
||||
+++ b/collectors/ebpf.plugin/Makefile.am
|
||||
@@ -9,7 +9,7 @@ SUFFIXES = .in
|
||||
userebpfconfigdir=$(configdir)/ebpf.d
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(userebpfconfigdir)
|
||||
|
||||
dist_noinst_DATA = \
|
||||
diff --git a/collectors/node.d.plugin/Makefile.am b/collectors/node.d.plugin/Makefile.am
|
||||
index c3142d433..95e324455 100644
|
||||
--- a/collectors/node.d.plugin/Makefile.am
|
||||
+++ b/collectors/node.d.plugin/Makefile.am
|
||||
@@ -26,7 +26,7 @@ dist_usernodeconfig_DATA = \
|
||||
$(NULL)
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(usernodeconfigdir)
|
||||
|
||||
nodeconfigdir=$(libconfigdir)/node.d
|
||||
diff --git a/collectors/python.d.plugin/Makefile.am b/collectors/python.d.plugin/Makefile.am
|
||||
index 38eb90f79..ce7079441 100644
|
||||
--- a/collectors/python.d.plugin/Makefile.am
|
||||
+++ b/collectors/python.d.plugin/Makefile.am
|
||||
@@ -32,7 +32,7 @@ dist_userpythonconfig_DATA = \
|
||||
$(NULL)
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(userpythonconfigdir)
|
||||
|
||||
pythonconfigdir=$(libconfigdir)/python.d
|
||||
diff --git a/collectors/statsd.plugin/Makefile.am b/collectors/statsd.plugin/Makefile.am
|
||||
index 71f2d468d..2c9ced2bf 100644
|
||||
--- a/collectors/statsd.plugin/Makefile.am
|
||||
+++ b/collectors/statsd.plugin/Makefile.am
|
||||
@@ -18,5 +18,5 @@ dist_userstatsdconfig_DATA = \
|
||||
$(NULL)
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(userstatsdconfigdir)
|
||||
diff --git a/health/Makefile.am b/health/Makefile.am
|
||||
index 349b86d61..514f1874f 100644
|
||||
--- a/health/Makefile.am
|
||||
+++ b/health/Makefile.am
|
||||
@@ -19,7 +19,7 @@ dist_userhealthconfig_DATA = \
|
||||
$(NULL)
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(userhealthconfigdir)
|
||||
|
||||
healthconfigdir=$(libconfigdir)/health.d
|
||||
diff --git a/system/Makefile.am b/system/Makefile.am
|
||||
index a88ccab65..bda6ee2b6 100644
|
||||
--- a/system/Makefile.am
|
||||
+++ b/system/Makefile.am
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
|
||||
CLEANFILES = \
|
||||
- edit-config \
|
||||
netdata-openrc \
|
||||
netdata.logrotate \
|
||||
netdata.service \
|
||||
@@ -20,15 +19,13 @@ include $(top_srcdir)/build/subst.inc
|
||||
SUFFIXES = .in
|
||||
|
||||
dist_config_SCRIPTS = \
|
||||
- edit-config \
|
||||
$(NULL)
|
||||
|
||||
dist_config_DATA = \
|
||||
- .install-type \
|
||||
$(NULL)
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(configdir)
|
||||
|
||||
nodist_noinst_DATA = \
|
||||
diff --git a/web/Makefile.am b/web/Makefile.am
|
||||
index ccaccd764..16a2977e5 100644
|
||||
--- a/web/Makefile.am
|
||||
+++ b/web/Makefile.am
|
||||
@@ -12,7 +12,7 @@ SUBDIRS = \
|
||||
usersslconfigdir=$(configdir)/ssl
|
||||
|
||||
# Explicitly install directories to avoid permission issues due to umask
|
||||
-install-exec-local:
|
||||
+no-install-exec-local:
|
||||
$(INSTALL) -d $(DESTDIR)$(usersslconfigdir)
|
||||
|
||||
dist_noinst_DATA = \
|
||||
16
pkgs/tools/system/netdata/skip-CONFIGURE_COMMAND.patch
Normal file
16
pkgs/tools/system/netdata/skip-CONFIGURE_COMMAND.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Shrink closure size by avoiding paths embedded from configure call.
|
||||
|
||||
https://github.com/NixOS/nixpkgs/issues/175693
|
||||
--- a/daemon/buildinfo.c
|
||||
+++ b/daemon/buildinfo.c
|
||||
@@ -248,7 +248,9 @@ void print_build_info(void) {
|
||||
char *prebuilt_distro = NULL;
|
||||
get_install_type(&install_type, &prebuilt_arch, &prebuilt_distro);
|
||||
|
||||
- printf("Configure options: %s\n", CONFIGURE_COMMAND);
|
||||
+ // To minimize closure size do not persist configure options
|
||||
+ // with build-time inputs.
|
||||
+ printf("Configure options: REMOVED\n");
|
||||
|
||||
if (install_type == NULL) {
|
||||
printf("Install type: unknown\n");
|
||||
Loading…
Add table
Add a link
Reference in a new issue