summary refs log tree commit diff
path: root/pkgs/tools/networking/netselect/default.nix
blob: c40f43c214fc686fa32a06f330319f89bad2d15b (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, fetchFromGitHub }:

stdenv.mkDerivation rec {
  pname = "netselect";
  version = "0.4";

  src = fetchFromGitHub {
    owner = "apenwarr";
    repo = "netselect";
    rev = "${pname}-${version}";
    sha256 = "1zncyvjzllrjbdvz7c50d1xjyhs9mwqfy92ndpfc5b3mxqslw4kx";
  };

  postPatch = ''
    substituteInPlace netselect-apt \
      --replace "/usr/bin/" ""
  '';

  makeFlags = [ "PREFIX=$(out)" ];

  installPhase = ''
    runHook preInstall
    install -Dm555 -t $out/bin netselect netselect-apt
    install -Dm444 -t $out/share/man/man1 *.1
    runHook postInstall
  '';

  meta = with stdenv.lib; {
    homepage = https://github.com/apenwarr/netselect;
    description = "An ultrafast intelligent parallelizing binary-search implementation of \"ping\"";
    license = licenses.bsd3;
    platforms = platforms.linux;
  };
}