- doc
[oweals/gnunet.git] / gnunet-dev.nix
1 { stdenv, makeWrapper, pkgconfig, autoconf, automake, ccache, ccache_dir ? ""
2 , adns, curl, gettext, gmp, gnutls, gss, ncurses, openldap
3 , jansson, zlib, sqlite, mariadb, postgresql
4 , libextractor, libgcrypt, libgnurl, libidn, libmicrohttpd
5 , libpsl, libtool, libunistring, libxml2
6 }:
7
8 stdenv.mkDerivation rec {
9   src = ./.;
10   name = "gnunet-dev";
11
12   buildInputs = [
13     makeWrapper pkgconfig autoconf automake ccache
14     adns curl gettext gmp gnutls gss ncurses openldap
15     jansson zlib sqlite mariadb postgresql
16     libextractor libgcrypt libgnurl libidn libmicrohttpd
17     libpsl libtool libunistring libxml2
18   ];
19
20   patchPhase = ''
21     if [ -e Makefile ]; then
22       make distclean
23     fi
24   '';
25
26   NIX_CFLAGS_COMPILE = "-ggdb -O0";
27
28   configureFlags = [
29     "--enable-gcc-hardening"
30     "--enable-linker-hardening"
31
32     "--enable-experimental"
33     "--enable-logging=verbose"
34     "--enable-poisoning"
35   ];
36
37   preConfigure = ''
38     ./bootstrap
39     configureFlags="$configureFlags --with-nssdir=$out/lib"
40
41     if [ -n "${ccache_dir}" ]; then
42       export CC='ccache gcc'
43       export CCACHE_COMPRESS=1
44       export CCACHE_DIR="${ccache_dir}"
45       export CCACHE_UMASK=007
46     fi
47   '';
48
49   doCheck = false;
50
51   postInstall = ''
52     # Tests can be run this way
53     #export GNUNET_PREFIX="$out"
54     #export PATH="$out/bin:$PATH"
55     #make -k check
56   '';
57
58   meta = with stdenv.lib; {
59     description = "GNU's decentralized anonymous and censorship-resistant P2P framework";
60
61     longDescription = ''
62       GNUnet is a framework for secure peer-to-peer networking that
63       does not use any centralized or otherwise trusted services.  A
64       first service implemented on top of the networking layer
65       allows anonymous censorship-resistant file-sharing.  Anonymity
66       is provided by making messages originating from a peer
67       indistinguishable from messages that the peer is routing.  All
68       peers act as routers and use link-encrypted connections with
69       stable bandwidth utilization to communicate with each other.
70       GNUnet uses a simple, excess-based economic model to allocate
71       resources.  Peers in GNUnet monitor each others behavior with
72       respect to resource usage; peers that contribute to the
73       network are rewarded with better service.
74     '';
75
76     homepage = https://gnunet.org/;
77
78     license = licenses.gpl3Plus;
79     platforms = platforms.gnu;
80     maintainers = with maintainers; [ ];
81   };
82 }