lol
1{ stdenv, fetchFromGitHub, autoreconfHook, libsodium, ncurses, libopus
2, libvpx, check, libconfig, pkgconfig }:
3
4stdenv.mkDerivation rec {
5 name = "tox-core-new-20160727";
6
7 src = fetchFromGitHub {
8 owner = "irungentoo";
9 repo = "toxcore";
10 rev = "755f084e8720b349026c85afbad58954cb7ff1d4";
11 sha256 = "0ap1gvlyihnfivv235dbrgsxsiiz70bhlmlr5gn1027w3h5kqz8w";
12 };
13
14 NIX_LDFLAGS = "-lgcc_s";
15
16 postPatch = ''
17 # within Nix chroot builds, localhost is unresolvable
18 sed -i -e '/DEFTESTCASE(addr_resolv_localhost)/d' \
19 auto_tests/network_test.c
20 # takes WAAAY too long (~10 minutes) and would timeout
21 sed -i -e '/DEFTESTCASE[^(]*(many_clients\>/d' \
22 auto_tests/tox_test.c
23 '';
24
25 configureFlags = [
26 "--with-libsodium-headers=${libsodium.dev}/include"
27 "--with-libsodium-libs=${libsodium.out}/lib"
28 "--enable-ntox"
29 "--enable-daemon"
30 ];
31
32
33 nativeBuildInputs = [ autoreconfHook pkgconfig ];
34 buildInputs = [
35 autoreconfHook libsodium ncurses check libconfig
36 ] ++ stdenv.lib.optionals (!stdenv.isArm) [
37 libopus
38 ];
39
40 propagatedBuildInputs = stdenv.lib.optionals (!stdenv.isArm) [ libvpx ];
41
42 # Some tests fail randomly due to timeout. This kind of problem is well known
43 # by upstream: https://github.com/irungentoo/toxcore/issues/{950,1054}
44 # They don't recommend running tests on 50core machines with other cpu-bound
45 # tests running in parallel.
46 #
47 # NOTE: run the tests locally on your machine before upgrading this package!
48 doCheck = false;
49
50 meta = with stdenv.lib; {
51 description = "P2P FOSS instant messaging application aimed to replace Skype with crypto";
52 license = licenses.gpl3Plus;
53 maintainers = with maintainers; [ viric jgeerds ];
54 platforms = platforms.all;
55 };
56}