summary refs log tree commit diff
path: root/pkgs/tools/networking/pingtcp/default.nix
blob: 784639b788c3a72b1fe1dec90cffc87dd0946b98 (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
35
36
37
{ stdenv, fetchgit, cmake }:

let version = "0.0.3"; in
stdenv.mkDerivation {
  name = "pingtcp-${version}";

  # This project uses git submodules, which fetchFromGitHub doesn't support:
  src = fetchgit {
    sha256 = "0an4dbwcp2qv1n068q0s34lz88vl1z2rqfh3j9apbq7bislsrwdd";
    rev = "refs/tags/v${version}";
    url = "https://github.com/LanetNetwork/pingtcp.git";
  };

  nativeBuildInputs = [ cmake ];

  postPatch = ''
    substituteInPlace {.,pfcquirks}/CMakeLists.txt \
      --replace "-march=native" ""
  '';

  enableParallelBuilding = true;

  doCheck = false;

  postInstall = ''
    install -Dm644 {..,$out/share/doc/pingtcp}/README.md
  '';

  meta = with stdenv.lib; {
    inherit version;
    description = "Measure TCP handshake time";
    homepage = https://github.com/LanetNetwork/pingtcp;
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ nckx ];
  };
}