1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromGitHub,
6 installShellFiles,
7 iputils,
8 versionCheckHook,
9 nix-update-script,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "gping";
14 version = "1.19.0";
15
16 src = fetchFromGitHub {
17 owner = "orf";
18 repo = "gping";
19 tag = "gping-v${version}";
20 hash = "sha256-RTjYgsi3PmmPufdTcxZr+Laipa32Kkq1M1eHSAJVWZQ=";
21 };
22
23 cargoHash = "sha256-b7GsaAaCYz3ohE4BUHlvexJ41L0OhbcWkBo61X4FKzQ=";
24
25 nativeBuildInputs = [ installShellFiles ];
26
27 nativeCheckInputs = lib.optionals stdenv.hostPlatform.isLinux [ iputils ];
28
29 postInstall = ''
30 installManPage gping.1
31 '';
32
33 # Requires internet access
34 checkFlags = [
35 "--skip=test::tests::test_integration_any"
36 "--skip=test::tests::test_integration_ip6"
37 "--skip=test::tests::test_integration_ipv4"
38 ];
39
40 doInstallCheck = true;
41
42 nativeInstallCheckInputs = [ versionCheckHook ];
43
44 versionCheckProgramArg = "--version";
45
46 passthru.updateScript = nix-update-script { };
47
48 meta = {
49 description = "Ping, but with a graph";
50 homepage = "https://github.com/orf/gping";
51 changelog = "https://github.com/orf/gping/releases/tag/gping-v${version}";
52 license = lib.licenses.mit;
53 maintainers = with lib.maintainers; [ cafkafk ];
54 mainProgram = "gping";
55 };
56}