@@ -0,0 +1,43 @@
1+{ stdenv, fetchFromGitHub, premake5, doxygen, libsodium, mbedtls }:
2+
3+stdenv.mkDerivation rec {
4+ name = "yojimbo";
5+ version = "1.1";
6+
7+ src = fetchFromGitHub {
8+ owner = "networkprotocol";
9+ repo = "yojimbo";
10+ rev = "e02219c102d9b440290539036992d77608eab3b0";
11+ sha256 = "0jn25ddv73hwjals883a910m66kwj6glxxhnmn96bpzsvsaimnkr";
12+ fetchSubmodules = true;
13+ };
14+
15+ nativeBuildInputs = [ premake5 doxygen ];
16+ propagatedBuildInputs = [ libsodium mbedtls ];
17+
18+ buildPhase = ''
19+ premake5 gmake
20+ make all
21+ premake5 docs
22+ '';
23+
24+ installPhase = ''
25+ install -Dm555 -t $out/lib bin/libyojimbo.a
26+ install -Dm444 -t $out/include yojimbo.h
27+ mkdir -p $out/share/doc/yojimbo
28+ cp -r docs/html $out/share/doc/yojimbo
29+ '';
30+
31+ meta = with stdenv.lib; {
32+ description = "A network library for client/server games with dedicated servers";
33+ longDescription = ''
34+ yojimbo is a network library for client/server games with dedicated servers.
35+ It's designed around the networking requirements of competitive multiplayer games like first person shooters.
36+ 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.
37+ '';
38+ homepage = https://github.com/networkprotocol/yojimbo;
39+ license = licenses.bsd3;
40+ platforms = platforms.x86_64;
41+ maintainers = with maintainers; [ paddygord ];
42+ };
43+}