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
This commit is contained in:
Janne Heß 2022-01-17 17:34:32 +01:00
parent 483aec3fe0
commit 69801692ae
No known key found for this signature in database
GPG Key ID: 69165158F05265DF

View File

@ -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;
};