From 5e6e3520df70cf2be576d4fb133cca7db9d9d5ba Mon Sep 17 00:00:00 2001 From: fridtjof Date: Tue, 3 Sep 2024 13:31:47 +0200 Subject: [PATCH] net-snmp: darwin support The autotools files shipped in the source tarball did not want to link, so I added autoreconfHook to just remake them. --- pkgs/servers/monitoring/net-snmp/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/monitoring/net-snmp/default.nix b/pkgs/servers/monitoring/net-snmp/default.nix index 66085a04babd..3f5c8c84701e 100644 --- a/pkgs/servers/monitoring/net-snmp/default.nix +++ b/pkgs/servers/monitoring/net-snmp/default.nix @@ -1,6 +1,8 @@ { lib, stdenv, fetchurl , file, openssl, perl, nettools -, withPerlTools ? false }: let +, autoreconfHook +, withPerlTools ? false +, darwin }: let perlWithPkgs = perl.withPackages (ps: with ps; [ JSON @@ -52,9 +54,15 @@ in stdenv.mkDerivation rec { -e "/NETSNMP_CONFIGURE_OPTIONS/ s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" ''; - nativeBuildInputs = [ nettools file ]; + nativeBuildInputs = [ nettools file autoreconfHook ]; buildInputs = [ openssl ] - ++ lib.optional withPerlTools perlWithPkgs; + ++ lib.optional withPerlTools perlWithPkgs + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.ApplicationServices + darwin.apple_sdk.frameworks.CoreServices + darwin.apple_sdk.frameworks.IOKit + darwin.apple_sdk.frameworks.DiskArbitration + ]; enableParallelBuilding = true; # Missing dependencies during relinking: @@ -74,6 +82,6 @@ in stdenv.mkDerivation rec { description = "Clients and server for the SNMP network monitoring protocol"; homepage = "http://www.net-snmp.org/"; license = licenses.bsd3; - platforms = platforms.linux; + platforms = platforms.unix; }; }