From e71334992211c992efc46fa95f932a94fcdac7e4 Mon Sep 17 00:00:00 2001 From: volth Date: Thu, 28 Sep 2017 20:05:07 +0000 Subject: [PATCH] collectd: fix darwin build (#29841) - liboping supported on darwin since #29849 - libmicrohttpd supported on darwin since #29848 --- pkgs/tools/system/collectd/default.nix | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/system/collectd/default.nix b/pkgs/tools/system/collectd/default.nix index 824eb74b72e..2e12345783d 100644 --- a/pkgs/tools/system/collectd/default.nix +++ b/pkgs/tools/system/collectd/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl +{ stdenv, fetchurl, darwin # optional: , pkgconfig ? null # most of the extra deps need pkgconfig to be found , curl ? null @@ -44,16 +44,22 @@ stdenv.mkDerivation rec { }; buildInputs = [ - pkgconfig curl iptables libatasmart libcredis libdbi libgcrypt libmemcached - cyrus_sasl libmodbus libnotify gdk_pixbuf liboping libpcap libsigrok libvirt - lm_sensors libxml2 lvm2 libmysql postgresql protobufc rabbitmq-c rrdtool - varnish yajl jdk libtool python udev net_snmp hiredis libmnl libmicrohttpd + pkgconfig curl libdbi libgcrypt libmemcached + cyrus_sasl libnotify gdk_pixbuf liboping libpcap libvirt + libxml2 libmysql postgresql protobufc rrdtool + varnish yajl jdk libtool python hiredis libmicrohttpd + ] ++ stdenv.lib.optionals stdenv.isLinux [ + iptables libatasmart libcredis libmodbus libsigrok + lm_sensors lvm2 rabbitmq-c udev net_snmp libmnl + ] ++ stdenv.lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.IOKit + darwin.apple_sdk.frameworks.ApplicationServices ]; # for some reason libsigrok isn't auto-detected configureFlags = [ "--localstatedir=/var" ] ++ - stdenv.lib.optional (libsigrok != null) "--with-libsigrok" ++ + stdenv.lib.optional (stdenv.isLinux && libsigrok != null) "--with-libsigrok" ++ stdenv.lib.optional (python != null) "--with-python=${python}/bin/python"; # do not create directories in /var during installPhase @@ -71,7 +77,7 @@ stdenv.mkDerivation rec { description = "Daemon which collects system performance statistics periodically"; homepage = https://collectd.org; license = licenses.gpl2; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ bjornfor fpletz ]; }; }