1{ stdenv, fetchFromGitHub, cmake, libsodium, ncurses, libopus, libmsgpack
2, libvpx, check, libconfig, pkgconfig }:
3
4stdenv.mkDerivation rec {
5 name = "libtoxcore-${version}";
6 version = "0.1.11";
7
8 src = fetchFromGitHub {
9 owner = "TokTok";
10 repo = "c-toxcore";
11 rev = "v${version}";
12 sha256 = "1fya5gfiwlpk6fxhalv95n945ymvp2iidiyksrjw1xw95fzsp1ij";
13 };
14
15 cmakeFlags = [
16 "-DBUILD_NTOX=ON"
17 "-DDHT_BOOTSTRAP=ON"
18 "-DBOOTSTRAP_DAEMON=ON"
19 ];
20
21 buildInputs = [
22 libsodium libmsgpack ncurses libconfig
23 ] ++ stdenv.lib.optionals (!stdenv.isArm) [
24 libopus
25 libvpx
26 ];
27
28 nativeBuildInputs = [ cmake pkgconfig ];
29
30 enableParallelBuilding = true;
31
32 checkInputs = [ check ];
33
34 checkPhase = "ctest";
35
36 # for some reason the tests are not running - it says "No tests found!!"
37 doCheck = true;
38
39 meta = with stdenv.lib; {
40 description = "P2P FOSS instant messaging application aimed to replace Skype";
41 homepage = https://tox.chat;
42 license = licenses.gpl3Plus;
43 maintainers = with maintainers; [ peterhoeg ];
44 platforms = platforms.all;
45 };
46}