summary refs log tree commit diff
path: root/pkgs/tools/networking/mtr/default.nix
blob: 03a0c99c4213528b696839807be639bf809a98f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{stdenv, fetchurl, autoreconfHook, pkgconfig, ncurses
, withGtk ? false, gtk2 ? null}:

assert withGtk -> gtk2 != null;

with stdenv.lib;
stdenv.mkDerivation rec {
  baseName="mtr";
  version="0.87";
  name="${baseName}-${version}";

  src = fetchurl {
    url="ftp://ftp.bitwizard.nl/${baseName}/${name}.tar.gz";
    sha256 = "17zi99n8bdqrwrnbfyjn327jz4gxx287wrq3vk459c933p34ff8r";
  };

  preConfigure = "substituteInPlace Makefile.in --replace ' install-exec-hook' ''";

  configureFlags = optionalString (!withGtk) "--without-gtk";

  nativeBuildInputs = [ autoreconfHook pkgconfig ];

  buildInputs = [ ncurses ] ++ optional withGtk gtk2;

  enableParallelBuilding = true;

  meta = {
    homepage = http://www.bitwizard.nl/mtr/;
    description = "A network diagnostics tool";
    maintainers = with maintainers; [ koral orivej raskin ];
    platforms = platforms.unix;
    license = licenses.gpl2;
  };
}