nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, cmake, libsodium, ncurses, libopus, msgpack
2, libvpx, check, libconfig, pkg-config }:
3
4let
5 generic = { version, sha256 }:
6 stdenv.mkDerivation {
7 pname = "libtoxcore";
8 inherit version;
9
10 src = fetchFromGitHub {
11 owner = "TokTok";
12 repo = "c-toxcore";
13 rev = "v${version}";
14 inherit sha256;
15 };
16
17 cmakeFlags = [
18 "-DBUILD_NTOX=ON"
19 "-DDHT_BOOTSTRAP=ON"
20 "-DBOOTSTRAP_DAEMON=ON"
21 ];
22
23 buildInputs = [
24 libsodium msgpack ncurses libconfig
25 ] ++ lib.optionals (!stdenv.isAarch32) [
26 libopus libvpx
27 ];
28
29 nativeBuildInputs = [ cmake pkg-config ];
30
31 doCheck = false; # hangs, tries to access the net?
32 checkInputs = [ check ];
33
34 postFixup =''
35 sed -i $out/lib/pkgconfig/*.pc \
36 -e "s|^libdir=.*|libdir=$out/lib|" \
37 -e "s|^includedir=.*|includedir=$out/include|"
38 '';
39
40 meta = with lib; {
41 broken = stdenv.isDarwin;
42 description = "P2P FOSS instant messaging application aimed to replace Skype";
43 homepage = "https://tox.chat";
44 license = licenses.gpl3Plus;
45 maintainers = with maintainers; [ peterhoeg ];
46 platforms = platforms.all;
47 };
48 };
49
50in {
51 libtoxcore_0_1 = generic {
52 version = "0.1.11";
53 sha256 = "1fya5gfiwlpk6fxhalv95n945ymvp2iidiyksrjw1xw95fzsp1ij";
54 };
55
56 libtoxcore_0_2 = generic {
57 version = "0.2.17";
58 sha256 = "sha256-SOI6QKOSt/EK9JDrSaV6CrD5sx8aYb5ZL3StYq8u/Dg=";
59 };
60}