From 69801692ae575e742061919a4786e1b1af1169ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 17 Jan 2022 17:34:32 +0100 Subject: [PATCH] net-snmp: General fixup - Remove unused inputs (unzip, ncurses) - Make some buildInputs native - Fix website - Wrap the needed perl libraries using `withPackages` - Make Perl support optional and disable it by default because it didn't work previously because net-snmp is built without its perl modules (the SNMP module to be specific) which the perl tools need --- pkgs/servers/monitoring/net-snmp/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/servers/monitoring/net-snmp/default.nix b/pkgs/servers/monitoring/net-snmp/default.nix index 5e4f1545e582..884b358644ac 100644 --- a/pkgs/servers/monitoring/net-snmp/default.nix +++ b/pkgs/servers/monitoring/net-snmp/default.nix @@ -1,7 +1,14 @@ { lib, stdenv, fetchurl, fetchpatch, autoreconfHook, removeReferencesTo -, file, openssl, perl, perlPackages, unzip, nettools, ncurses }: +, file, openssl, perl, perlPackages, nettools, gnused +, withPerlTools ? false }: let -stdenv.mkDerivation rec { + perlWithPkgs = perl.withPackages (ps: with ps; [ + JSON + TermReadKey + Tk + ]); + +in stdenv.mkDerivation rec { pname = "net-snmp"; version = "5.9.1"; @@ -37,8 +44,9 @@ stdenv.mkDerivation rec { substituteInPlace testing/fulltests/support/simple_TESTCONF.sh --replace "/bin/netstat" "${nettools}/bin/netstat" ''; - nativeBuildInputs = [ autoreconfHook nettools removeReferencesTo unzip ]; - buildInputs = with perlPackages; [ file perl openssl ncurses JSON Tk TermReadKey ]; + nativeBuildInputs = [ autoreconfHook nettools removeReferencesTo gnused file ]; + buildInputs = [ openssl ] + ++ lib.optional withPerlTools perlWithPkgs; enableParallelBuilding = true; doCheck = false; # tries to use networking @@ -56,7 +64,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Clients and server for the SNMP network monitoring protocol"; - homepage = "http://net-snmp.sourceforge.net/"; + homepage = "http://www.net-snmp.org/"; license = licenses.bsd3; platforms = platforms.linux; };