1 { lib, stdenv, fetchurl, ncurses, libpcap, automake, nixosTests }:
3 stdenv.mkDerivation rec {
8 url = "http://ex-parrot.com/pdw/iftop/download/iftop-${version}.tar.gz";
9 sha256 = "15sgkdyijb7vbxpxjavh5qm5nvyii3fqcg9mzvw7fx8s6zmfwczp";
12 # Explicitly link against libgcc_s, to work around the infamous
13 # "libgcc_s.so.1 must be installed for pthread_cancel to work".
14 LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-lgcc_s";
17 cp ${automake}/share/automake*/config.{sub,guess} config
20 buildInputs = [ncurses libpcap];
22 # Workaround build failure on -fno-common toolchains like upstream
23 # gcc-10. Otherwise build fails as:
24 # ld: tui.o:/build/iftop-1.0pre4/ui_common.h:41: multiple definition of `service_hash';
25 # iftop.o:/build/iftop-1.0pre4/ui_common.h:41: first defined here
26 env.NIX_CFLAGS_COMPILE = "-fcommon";
28 passthru.tests = { inherit (nixosTests) iftop; };
31 description = "Display bandwidth usage on a network interface";
33 iftop does for network usage what top(1) does for CPU usage. It listens
34 to network traffic on a named interface and displays a table of current
35 bandwidth usage by pairs of hosts.
37 license = licenses.gpl2Plus;
38 homepage = "http://ex-parrot.com/pdw/iftop/";
39 platforms = platforms.unix;
41 mainProgram = "iftop";