1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 libssh,
6}:
7
8stdenv.mkDerivation rec {
9 pname = "sshping";
10 version = "0.1.4";
11
12 src = fetchFromGitHub {
13 owner = "spook";
14 repo = "sshping";
15 rev = "v${version}";
16 sha256 = "0p1fvpgrsy44yvj44xp9k9nf6z1fh0sqcjvy75pcb9f5icgms815";
17 };
18
19 buildInputs = [ libssh ];
20
21 buildPhase = ''
22 $CXX -Wall -I ext/ -o bin/sshping src/sshping.cxx -lssh
23 '';
24
25 installPhase = ''
26 install -Dm755 bin/sshping $out/bin/sshping
27 '';
28
29 meta = with lib; {
30 homepage = "https://github.com/spook/sshping";
31 description = "Measure character-echo latency and bandwidth for an interactive ssh session";
32 license = licenses.mit;
33 platforms = platforms.unix;
34 maintainers = with maintainers; [ jqueiroz ];
35 mainProgram = "sshping";
36 };
37}