summary refs log tree commit diff
path: root/pkgs/development/libraries/yojimbo/default.nix
blob: d3df30e03e18a22174d4478202bf7b46f985515d (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
{ stdenv, fetchFromGitHub, premake5, doxygen, libsodium, mbedtls }:

stdenv.mkDerivation {
  pname = "yojimbo";
  version = "1.1";

  src = fetchFromGitHub {
    owner = "networkprotocol";
    repo = "yojimbo";
    rev = "e02219c102d9b440290539036992d77608eab3b0";
    sha256 = "0jn25ddv73hwjals883a910m66kwj6glxxhnmn96bpzsvsaimnkr";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [ premake5 doxygen ];
  propagatedBuildInputs = [ libsodium mbedtls ];

  postBuild = ''
    premake5 docs
  '';

  installPhase = ''
    install -Dm555 -t $out/lib bin/libyojimbo.a
    install -Dm444 -t $out/include yojimbo.h
    mkdir -p $out/share/doc/yojimbo
    cp -r docs/html $out/share/doc/yojimbo
  '';

  doCheck = true;

  meta = with stdenv.lib; {
    description = "A network library for client/server games with dedicated servers";
    longDescription = ''
      yojimbo is a network library for client/server games with dedicated servers.
      It's designed around the networking requirements of competitive multiplayer games like first person shooters.
      As such it provides a time critical networking layer on top of UDP, with a client/server architecture supporting up to 64 players per-dedicated server instance.
    '';
    homepage = https://github.com/networkprotocol/yojimbo;
    license = licenses.bsd3;
    platforms = platforms.x86_64;
    maintainers = with maintainers; [ paddygord ];
  };
}