2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, ncurses, libpcap, automake, nixosTests }:
|
2009-10-08 07:01:55 +00:00
|
|
|
|
2021-08-01 20:48:53 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "iftop";
|
|
|
|
version = "1.0pre4";
|
2009-10-08 07:01:55 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-01 20:48:53 +00:00
|
|
|
url = "http://ex-parrot.com/pdw/iftop/download/iftop-${version}.tar.gz";
|
2015-10-24 23:36:43 +00:00
|
|
|
sha256 = "15sgkdyijb7vbxpxjavh5qm5nvyii3fqcg9mzvw7fx8s6zmfwczp";
|
2009-10-08 07:01:55 +00:00
|
|
|
};
|
|
|
|
|
2013-03-08 08:08:57 +00:00
|
|
|
# Explicitly link against libgcc_s, to work around the infamous
|
|
|
|
# "libgcc_s.so.1 must be installed for pthread_cancel to work".
|
2021-01-15 09:19:50 +00:00
|
|
|
LDFLAGS = lib.optionalString stdenv.isLinux "-lgcc_s";
|
2013-03-08 08:08:57 +00:00
|
|
|
|
2010-10-03 09:18:55 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cp ${automake}/share/automake*/config.{sub,guess} config
|
|
|
|
'';
|
|
|
|
|
2009-10-08 07:01:55 +00:00
|
|
|
buildInputs = [ncurses libpcap];
|
|
|
|
|
2022-05-15 09:44:06 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: tui.o:/build/iftop-1.0pre4/ui_common.h:41: multiple definition of `service_hash';
|
|
|
|
# iftop.o:/build/iftop-1.0pre4/ui_common.h:41: first defined here
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-05-15 09:44:06 +00:00
|
|
|
|
2020-04-15 19:59:34 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) iftop; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2013-07-28 12:04:44 +00:00
|
|
|
description = "Display bandwidth usage on a network interface";
|
|
|
|
longDescription = ''
|
|
|
|
iftop does for network usage what top(1) does for CPU usage. It listens
|
|
|
|
to network traffic on a named interface and displays a table of current
|
|
|
|
bandwidth usage by pairs of hosts.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2Plus;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://ex-parrot.com/pdw/iftop/";
|
2015-07-06 00:47:54 +00:00
|
|
|
platforms = platforms.unix;
|
2018-01-17 05:13:23 +00:00
|
|
|
maintainers = [ ];
|
2009-10-08 07:01:55 +00:00
|
|
|
};
|
|
|
|
}
|