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