7ffc0d94ced3782966c736bbf580b06b4d9e293a
[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     test -e Makefile && make distclean
20   '';
21
22   NIX_CFLAGS_COMPILE = "-ggdb -O0";
23
24   configureFlags = [
25     "--enable-gcc-hardening"
26     "--enable-linker-hardening"
27
28     "--enable-experimental"
29     "--enable-logging=verbose"
30     "--enable-poisoning"
31   ];
32
33   preConfigure = ''
34     ./bootstrap
35     configureFlags="$configureFlags --with-nssdir=$out/lib"
36
37     if [ -n "${ccache_dir}" ]; then
38       export CC='ccache gcc'
39       export CCACHE_COMPRESS=1
40       export CCACHE_DIR="${ccache_dir}"
41       export CCACHE_UMASK=007
42     fi
43   '';
44
45   doCheck = false;
46
47   postInstall = ''
48     # Tests can be run this way
49     #export GNUNET_PREFIX="$out"
50     #export PATH="$out/bin:$PATH"
51     #make -k check
52   '';
53
54   meta = with stdenv.lib; {
55     description = "GNU's decentralized anonymous and censorship-resistant P2P framework";
56
57     longDescription = ''
58       GNUnet is a framework for secure peer-to-peer networking that
59       does not use any centralized or otherwise trusted services.  A
60       first service implemented on top of the networking layer
61       allows anonymous censorship-resistant file-sharing.  Anonymity
62       is provided by making messages originating from a peer
63       indistinguishable from messages that the peer is routing.  All
64       peers act as routers and use link-encrypted connections with
65       stable bandwidth utilization to communicate with each other.
66       GNUnet uses a simple, excess-based economic model to allocate
67       resources.  Peers in GNUnet monitor each others behavior with
68       respect to resource usage; peers that contribute to the
69       network are rewarded with better service.
70     '';
71
72     homepage = https://gnunet.org/;
73
74     license = licenses.gpl3Plus;
75     platforms = platforms.gnu;
76     maintainers = with maintainers; [ ];
77   };
78 }