2021-01-17 03:09:27 +01:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, neon, libusb-compat-0_1, openssl, udev, avahi, freeipmi
|
2019-11-24 15:54:00 +01:00
|
|
|
, libtool, makeWrapper, autoreconfHook, fetchpatch
|
|
|
|
}:
|
2011-06-14 04:41:01 +02:00
|
|
|
|
2012-12-12 16:17:47 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-11-24 15:54:00 +01:00
|
|
|
pname = "nut";
|
|
|
|
version = "2.7.4";
|
2012-09-28 18:15:12 +02:00
|
|
|
|
2011-06-14 04:41:01 +02:00
|
|
|
src = fetchurl {
|
2019-11-24 15:54:00 +01:00
|
|
|
url = "https://networkupstools.org/source/2.7/${pname}-${version}.tar.gz";
|
2017-04-24 06:04:07 +02:00
|
|
|
sha256 = "19r5dm07sfz495ckcgbfy0pasx0zy3faa0q7bih69lsjij8q43lq";
|
2011-06-14 04:41:01 +02:00
|
|
|
};
|
|
|
|
|
2019-11-24 15:54:00 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Fix build with openssl >= 1.1.0
|
|
|
|
url = "https://github.com/networkupstools/nut/commit/612c05efb3c3b243da603a3a050993281888b6e3.patch";
|
|
|
|
sha256 = "0jdbii1z5sqyv24286j5px65j7b3gp8zk3ahbph83pig6g46m3hs";
|
|
|
|
})
|
|
|
|
];
|
2011-06-14 04:41:01 +02:00
|
|
|
|
2020-04-28 05:29:39 +02:00
|
|
|
buildInputs = [ neon libusb-compat-0_1 openssl udev avahi freeipmi ];
|
2019-11-24 15:54:00 +01:00
|
|
|
|
2021-01-17 03:09:27 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook libtool pkg-config makeWrapper ];
|
2012-12-12 16:17:47 +01:00
|
|
|
|
|
|
|
configureFlags =
|
|
|
|
[ "--with-all"
|
|
|
|
"--with-ssl"
|
|
|
|
"--without-snmp" # Until we have it ...
|
|
|
|
"--without-powerman" # Until we have it ...
|
|
|
|
"--without-cgi"
|
|
|
|
"--without-hal"
|
2014-03-13 21:44:51 +01:00
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
2013-12-20 15:15:44 +01:00
|
|
|
"--with-udev-dir=$(out)/etc/udev"
|
2012-12-12 16:17:47 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2011-06-14 04:41:01 +02:00
|
|
|
|
2013-12-20 15:15:44 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/nut-scanner --prefix LD_LIBRARY_PATH : \
|
2020-04-28 05:29:39 +02:00
|
|
|
"$out/lib:${neon}/lib:${libusb-compat-0_1.out}/lib:${avahi}/lib:${freeipmi}/lib"
|
2013-12-20 15:15:44 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2011-06-14 04:41:01 +02:00
|
|
|
description = "Network UPS Tools";
|
|
|
|
longDescription = ''
|
|
|
|
Network UPS Tools is a collection of programs which provide a common
|
|
|
|
interface for monitoring and administering UPS, PDU and SCD hardware.
|
|
|
|
It uses a layered approach to connect all of the parts.
|
|
|
|
'';
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://networkupstools.org/";
|
|
|
|
repositories.git = "https://github.com/networkupstools/nut.git";
|
2018-09-01 14:16:42 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.pierron ];
|
|
|
|
license = with licenses; [ gpl1Plus gpl2Plus gpl3Plus ];
|
2012-12-12 16:17:47 +01:00
|
|
|
priority = 10;
|
2011-06-14 04:41:01 +02:00
|
|
|
};
|
|
|
|
}
|