base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / li / libtoxcore / package.nix
blob7e7619b1a2fbffe4d8afa141bd66e752f1a978fd
1 { lib
2 , stdenv
3 , fetchurl
4 , cmake
5 , libsodium
6 , ncurses
7 , libopus
8 , libvpx
9 , check
10 , libconfig
11 , pkg-config
14 let buildToxAV = !stdenv.hostPlatform.isAarch32;
15 in stdenv.mkDerivation rec {
16   pname = "libtoxcore";
17   version = "0.2.20";
19   src =
20     # We need the prepared sources tarball.
21     fetchurl {
22       url =
23         "https://github.com/TokTok/c-toxcore/releases/download/v${version}/c-toxcore-${version}.tar.gz";
24       hash = "sha256-qciaja6nRdU+XXjnqsuZx7R5LEQApaaccSOPRdYWT0w=";
25     };
27   cmakeFlags = [
28     "-DDHT_BOOTSTRAP=ON"
29     "-DBOOTSTRAP_DAEMON=ON"
30   ] ++ lib.optional buildToxAV "-DMUST_BUILD_TOXAV=ON";
32   buildInputs = [
33     libsodium
34     ncurses
35     libconfig
36   ] ++ lib.optionals buildToxAV [
37     libopus
38     libvpx
39   ];
41   nativeBuildInputs = [ cmake pkg-config ];
43   doCheck = true;
44   nativeCheckInputs = [ check ];
46   postInstall = ''
47     substituteInPlace $out/lib/pkgconfig/toxcore.pc \
48       --replace '=''${prefix}/' '=' \
50   '';
51   # We might be getting the wrong pkg-config file anyway:
52   # https://github.com/TokTok/c-toxcore/issues/2334
54   meta = {
55     description = "P2P FOSS instant messaging application aimed to replace Skype";
56     homepage = "https://tox.chat";
57     license = lib.licenses.gpl3Plus;
58     maintainers = with lib.maintainers; [ peterhoeg ehmry ];
59     platforms = lib.platforms.all;
60   };