1{ lib, stdenv, fetchFromGitHub }:
2
3stdenv.mkDerivation rec {
4 pname = "netselect";
5 version = "0.4";
6
7 src = fetchFromGitHub {
8 owner = "apenwarr";
9 repo = "netselect";
10 rev = "${pname}-${version}";
11 sha256 = "1zncyvjzllrjbdvz7c50d1xjyhs9mwqfy92ndpfc5b3mxqslw4kx";
12 };
13
14 postPatch = ''
15 substituteInPlace netselect-apt \
16 --replace "/usr/bin/" ""
17 '';
18
19 makeFlags = [ "PREFIX=$(out)" ];
20
21 installPhase = ''
22 runHook preInstall
23 install -Dm555 -t $out/bin netselect netselect-apt
24 install -Dm444 -t $out/share/man/man1 *.1
25 runHook postInstall
26 '';
27
28 meta = with lib; {
29 homepage = "https://github.com/apenwarr/netselect";
30 description = "An ultrafast intelligent parallelizing binary-search implementation of \"ping\"";
31 license = licenses.bsd3;
32 platforms = platforms.linux;
33 };
34}