about summary refs log tree commit diff
path: root/pkgs/tools/networking/stuntman/default.nix
blob: 3d2ff6eeb50c5dbd84d2db6ce91f397dda04ff86 (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
38
39
40
41
42
43
44
45
{ stdenv, lib, fetchFromGitHub, openssl, boost }:

stdenv.mkDerivation {
  pname = "stuntman";
  version = "1.2.16";

  src = fetchFromGitHub {
    owner = "jselbie";
    repo = "stunserver";
    rev = "cfadf9c3836d5ae63a682913de24ba085df924f3";
    sha256 = "1gcx4zj44f0viddnn5klkmq0dgd29av5p06iyf9f1va4a3lk0cbg";
  };

  buildInputs = [
    boost
    openssl
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    mv stunserver $out/bin/
    mv stunclient $out/bin/

    runHook postInstall
  '';

  doCheck = true;
  checkPhase = ''
    runHook preCheck

    ./stuntestcode

    runHook postCheck
  '';

  meta = with lib; {
    description = "STUNTMAN - an open source STUN server and client";
    homepage = "https://www.stunprotocol.org/";
    license = licenses.asl20;
    maintainers = with maintainers; [ mattchrist ];
    platforms = platforms.unix;
  };
}