2017-06-25 23:17:20 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, nlohmann_json,
|
|
|
|
libtoxcore, libsodium, systemd, libcap, zeromq }:
|
2016-05-29 22:07:54 +00:00
|
|
|
|
2017-06-25 23:17:20 +00:00
|
|
|
with stdenv.lib;
|
2016-05-29 22:07:54 +00:00
|
|
|
|
2017-06-25 23:17:20 +00:00
|
|
|
let
|
|
|
|
systemdOrNull = if stdenv.system == "x86_64-darwin" then null else systemd;
|
|
|
|
if_systemd = optional (systemdOrNull != null);
|
|
|
|
in stdenv.mkDerivation rec {
|
2017-02-14 06:59:59 +00:00
|
|
|
name = "toxvpn-${version}";
|
2017-06-25 23:17:20 +00:00
|
|
|
version = "2017-06-25";
|
2016-05-29 22:07:54 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cleverca22";
|
|
|
|
repo = "toxvpn";
|
2017-06-25 23:17:20 +00:00
|
|
|
rev = "7bd6f169d69c511affa8c9672e8f794e4e205a44";
|
|
|
|
sha256 = "1km8hkrxmrnca1b49vbw5kyldayaln5plvz78vhf8325r6c5san0";
|
2016-05-29 22:07:54 +00:00
|
|
|
};
|
|
|
|
|
2017-06-25 23:17:20 +00:00
|
|
|
buildInputs = [ libtoxcore nlohmann_json libsodium zeromq ]
|
|
|
|
++ if_systemd systemd
|
|
|
|
++ optional (stdenv.system != "x86_64-darwin") libcap;
|
2017-02-14 06:59:59 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2016-05-29 22:07:54 +00:00
|
|
|
|
2017-02-14 06:59:59 +00:00
|
|
|
cmakeFlags = optional stdenv.isLinux [ "-DSYSTEMD=1" ];
|
2016-05-29 22:07:54 +00:00
|
|
|
|
2017-06-25 23:17:20 +00:00
|
|
|
postInstall = "$out/bin/toxvpn -h";
|
|
|
|
|
2016-05-30 13:23:25 +00:00
|
|
|
meta = with stdenv.lib; {
|
2016-05-29 22:07:54 +00:00
|
|
|
description = "A powerful tool that allows one to make tunneled point to point connections over Tox";
|
|
|
|
homepage = https://github.com/cleverca22/toxvpn;
|
|
|
|
license = licenses.gpl3;
|
2016-05-30 13:23:25 +00:00
|
|
|
maintainers = with maintainers; [ cleverca22 obadz ];
|
2017-06-25 23:17:20 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2016-05-29 22:07:54 +00:00
|
|
|
};
|
|
|
|
}
|