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