1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 texinfo,
7 ncurses,
8 readline,
9 zlib,
10 lzo,
11 openssl,
12 nixosTests,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "tinc";
17 version = "1.1pre18";
18
19 src = fetchFromGitHub {
20 owner = "gsliepen";
21 repo = "tinc";
22 rev = "release-${version}";
23 hash = "sha256-1anjTUlVLx57FlUqGwBd590lfkZ2MmrM1qRcMl4P7Sg=";
24 };
25
26 outputs = [
27 "out"
28 "man"
29 "info"
30 ];
31
32 nativeBuildInputs = [
33 autoreconfHook
34 texinfo
35 ];
36 buildInputs = [
37 ncurses
38 readline
39 zlib
40 lzo
41 openssl
42 ];
43
44 # needed so the build doesn't need to run git to find out the version.
45 prePatch = ''
46 substituteInPlace configure.ac --replace UNKNOWN ${version}
47 echo "${version}" > configure-version
48 echo "https://tinc-vpn.org/git/browse?p=tinc;a=log;h=refs/tags/release-${version}" > ChangeLog
49 sed -i '/AC_INIT/s/m4_esyscmd_s.*/${version})/' configure.ac
50 '';
51
52 configureFlags = [
53 "--sysconfdir=/etc"
54 "--localstatedir=/var"
55 ];
56
57 passthru.tests = { inherit (nixosTests) tinc; };
58
59 meta = with lib; {
60 description = "VPN daemon with full mesh routing";
61 longDescription = ''
62 tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and
63 encryption to create a secure private network between hosts on the
64 Internet. It features full mesh routing, as well as encryption,
65 authentication, compression and ethernet bridging.
66 '';
67 homepage = "http://www.tinc-vpn.org/";
68 license = licenses.gpl2Plus;
69 platforms = platforms.unix;
70 maintainers = with maintainers; [
71 lassulus
72 mic92
73 ];
74 };
75}