python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / networking / tuntox / default.nix
blob6df9f724500d53f7d503d089ff464ef6ee1036a1
1 { lib
2 , stdenv
3 , cscope
4 , fetchFromGitHub
5 , fetchpatch
6 , git
7 , libevent
8 , libopus
9 , libsodium
10 , libtoxcore
11 , libvpx
12 , msgpack
13 , pkg-config
14 , python3
15 , python3Packages
18 stdenv.mkDerivation rec {
19   pname = "tuntox";
20   version = "0.0.10";
22   src = fetchFromGitHub {
23     owner = "gjedeer";
24     repo = pname;
25     rev = "${version}";
26     sha256 = "sha256-c/0OxUH8iw8nRuVg4Fszf6Z/JiEV+m0B2ofzy81uFu8=";
27   };
29   nativeBuildInputs = [ cscope git pkg-config ];
31   buildInputs = [ libopus libtoxcore libsodium libevent libvpx msgpack python3 ];
33   pythonBuildInputs = with python3Packages; [
34     jinja2
35     requests
36   ];
38   patches = [
39     # https://github.com/gjedeer/tuntox/pull/67
40     (fetchpatch {
41       url = "https://github.com/gjedeer/tuntox/compare/a646402f42e120c7148d4de29dbdf5b09027a80a..365d2e5cbc0e3655fb64c204db0515f5f4cdf5a4.patch";
42       sha256 = "sha256-P3uIRnV+pBi3s3agGYUMt2PZU4CRxx/DUR8QPVQ+UN8=";
43     })
44   ];
46   postPatch = ''
47       substituteInPlace gitversion.h --replace '7d45afdf7d00a95a8c3687175e2b1669fa1f7745' '365d2e5cbc0e3655fb64c204db0515f5f4cdf5a4'
48     '' + lib.optionalString stdenv.isLinux ''
49       substituteInPlace Makefile --replace ' -static ' ' '
50       substituteInPlace Makefile --replace 'CC=gcc' ' '
51     '' + lib.optionalString stdenv.isDarwin ''
52       substituteInPlace Makefile.mac --replace '.git/HEAD .git/index' ' '
53       substituteInPlace Makefile.mac --replace '/usr/local/lib/libtoxcore.a' '${libtoxcore}/lib/libtoxcore.a'
54       substituteInPlace Makefile.mac --replace '/usr/local/lib/libsodium.a' '${libsodium}/lib/libsodium.dylib'
55       substituteInPlace Makefile.mac --replace 'CC=gcc' ' '
56     '';
58   buildPhase = ''
59     '' + lib.optionalString stdenv.isLinux ''
60       make
61     '' + lib.optionalString stdenv.isDarwin ''
62       make -f Makefile.mac tuntox
63     '';
65   installPhase = ''
66     mkdir -p $out/bin
67     mv tuntox $out/bin/
68   '';
70   doCheck = false;
72   meta = with lib; {
73     description = "Tunnel TCP connections over the Tox protocol";
74     homepage = "https://github.com/gjedeer/tuntox";
75     license = licenses.gpl3;
76     maintainers = with maintainers; [
77       willcohen
78     ];
79     platforms = platforms.unix;
80   };