Skip to content

Commit 75fe950

Browse files
volthLnL7
volth
authored andcommittedSep 28, 2017
collectd: fix darwin build (#29841)
- liboping supported on darwin since #29849 - libmicrohttpd supported on darwin since #29848 (cherry picked from commit e713349)
1 parent e9e037f commit 75fe950

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed
 

‎pkgs/tools/system/collectd/default.nix

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ stdenv, fetchurl
1+
{ stdenv, fetchurl, darwin
22
# optional:
33
, pkgconfig ? null # most of the extra deps need pkgconfig to be found
44
, curl ? null
@@ -44,16 +44,22 @@ stdenv.mkDerivation rec {
4444
};
4545

4646
buildInputs = [
47-
pkgconfig curl iptables libatasmart libcredis libdbi libgcrypt libmemcached
48-
cyrus_sasl libmodbus libnotify gdk_pixbuf liboping libpcap libsigrok libvirt
49-
lm_sensors libxml2 lvm2 libmysql postgresql protobufc rabbitmq-c rrdtool
50-
varnish yajl jdk libtool python udev net_snmp hiredis libmnl libmicrohttpd
47+
pkgconfig curl libdbi libgcrypt libmemcached
48+
cyrus_sasl libnotify gdk_pixbuf liboping libpcap libvirt
49+
libxml2 libmysql postgresql protobufc rrdtool
50+
varnish yajl jdk libtool python hiredis libmicrohttpd
51+
] ++ stdenv.lib.optionals stdenv.isLinux [
52+
iptables libatasmart libcredis libmodbus libsigrok
53+
lm_sensors lvm2 rabbitmq-c udev net_snmp libmnl
54+
] ++ stdenv.lib.optionals stdenv.isDarwin [
55+
darwin.apple_sdk.frameworks.IOKit
56+
darwin.apple_sdk.frameworks.ApplicationServices
5157
];
5258

5359
# for some reason libsigrok isn't auto-detected
5460
configureFlags =
5561
[ "--localstatedir=/var" ] ++
56-
stdenv.lib.optional (libsigrok != null) "--with-libsigrok" ++
62+
stdenv.lib.optional (stdenv.isLinux && libsigrok != null) "--with-libsigrok" ++
5763
stdenv.lib.optional (python != null) "--with-python=${python}/bin/python";
5864

5965
# do not create directories in /var during installPhase
@@ -71,7 +77,7 @@ stdenv.mkDerivation rec {
7177
description = "Daemon which collects system performance statistics periodically";
7278
homepage = https://collectd.org;
7379
license = licenses.gpl2;
74-
platforms = platforms.linux;
80+
platforms = platforms.unix;
7581
maintainers = with maintainers; [ bjornfor fpletz ];
7682
};
7783
}

0 commit comments

Comments
 (0)
Please sign in to comment.