From eef5476659f1a4990e892122fcd9aa4e6157328f Mon Sep 17 00:00:00 2001 From: Dominik Honnef Date: Sat, 20 May 2023 15:42:49 +0200 Subject: [PATCH] nut: add support for SNMP and CGI --- pkgs/applications/misc/nut/default.nix | 7 ++++--- pkgs/applications/misc/nut/hardcode-paths.patch | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/nut/default.nix b/pkgs/applications/misc/nut/default.nix index 0afe4bf18c1e..4243dd50b87c 100644 --- a/pkgs/applications/misc/nut/default.nix +++ b/pkgs/applications/misc/nut/default.nix @@ -5,12 +5,14 @@ , coreutils , fetchurl , freeipmi +, gd , i2c-tools , libmodbus , libtool , libusb-compat-0_1 , makeWrapper , neon +, net-snmp , openssl , pkg-config , substituteAll @@ -35,19 +37,18 @@ stdenv.mkDerivation rec { libusb = "${libusb-compat-0_1}/lib"; neon = "${neon}/lib"; libmodbus = "${libmodbus}/lib"; + netsnmp = "${net-snmp.lib}/lib"; }) ]; - buildInputs = [ neon libusb-compat-0_1 openssl udev avahi freeipmi libmodbus i2c-tools ]; + buildInputs = [ neon libusb-compat-0_1 openssl udev avahi freeipmi libmodbus i2c-tools net-snmp gd ]; nativeBuildInputs = [ autoreconfHook libtool pkg-config makeWrapper ]; configureFlags = [ "--with-all" "--with-ssl" - "--without-snmp" # Until we have it ... "--without-powerman" # Until we have it ... - "--without-cgi" "--with-systemdsystemunitdir=$(out)/lib/systemd/system" "--with-systemdshutdowndir=$(out)/lib/systemd/system-shutdown" "--with-systemdtmpfilesdir=$(out)/lib/tmpfiles.d" diff --git a/pkgs/applications/misc/nut/hardcode-paths.patch b/pkgs/applications/misc/nut/hardcode-paths.patch index 5116fb438e53..a58d402a2058 100644 --- a/pkgs/applications/misc/nut/hardcode-paths.patch +++ b/pkgs/applications/misc/nut/hardcode-paths.patch @@ -1,6 +1,6 @@ --- a/common/common.c +++ b/common/common.c -@@ -991,6 +991,11 @@ ssize_t select_write(const int fd, const void *buf, const size_t buflen, const t +@@ -991,6 +991,12 @@ ssize_t select_write(const int fd, const void *buf, const size_t buflen, const t * communications media and/or vendor protocol. */ static const char * search_paths[] = { @@ -9,6 +9,7 @@ + "@libusb@", + "@neon@", + "@libmodbus@", ++ "@netsnmp@", /* Use the library path (and bitness) provided during ./configure first */ LIBDIR, "/usr"LIBDIR,