traefik: add djds as maintainer (#377217)
[NixPkgs.git] / pkgs / by-name / if / iftop / package.nix
blobea33e56f5b3569d8a73430941787e52ecf3863b1
2   lib,
3   stdenv,
4   fetchurl,
5   ncurses,
6   libpcap,
7   automake,
8   nixosTests,
9 }:
11 stdenv.mkDerivation rec {
12   pname = "iftop";
13   version = "1.0pre4";
15   src = fetchurl {
16     url = "http://ex-parrot.com/pdw/iftop/download/iftop-${version}.tar.gz";
17     sha256 = "15sgkdyijb7vbxpxjavh5qm5nvyii3fqcg9mzvw7fx8s6zmfwczp";
18   };
20   # Explicitly link against libgcc_s, to work around the infamous
21   # "libgcc_s.so.1 must be installed for pthread_cancel to work".
22   LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-lgcc_s";
24   preConfigure = ''
25     cp ${automake}/share/automake*/config.{sub,guess} config
26   '';
28   buildInputs = [
29     ncurses
30     libpcap
31   ];
33   # Workaround build failure on -fno-common toolchains like upstream
34   # gcc-10. Otherwise build fails as:
35   #   ld: tui.o:/build/iftop-1.0pre4/ui_common.h:41: multiple definition of `service_hash';
36   #     iftop.o:/build/iftop-1.0pre4/ui_common.h:41: first defined here
37   env.NIX_CFLAGS_COMPILE = "-fcommon";
39   passthru.tests = { inherit (nixosTests) iftop; };
41   meta = with lib; {
42     description = "Display bandwidth usage on a network interface";
43     longDescription = ''
44       iftop does for network usage what top(1) does for CPU usage. It listens
45       to network traffic on a named interface and displays a table of current
46       bandwidth usage by pairs of hosts.
47     '';
48     license = licenses.gpl2Plus;
49     homepage = "http://ex-parrot.com/pdw/iftop/";
50     platforms = platforms.unix;
51     maintainers = [ ];
52     mainProgram = "iftop";
53   };