1 # Nix package for GNUnet development
5 # To build and install the package in the user environment, use:
11 # To build the package and add it to the nix store, use:
17 # To launch a shell with all dependencies installed in the environment, use one of the following:
20 # After entering nix-shell, build it:
27 # For all of the above commands, nixpkgs to use can be set the following way:
29 # a) by default it uses nixpkgs pinned to a known working version
31 # b) use nixpkgs from the system:
34 # c) use nixpkgs at a given path
35 # --arg pkgs /path/to/nixpkgs
39 # To enable ccache, use the following:
41 # --argstr ccache_dir /var/cache/ccache
43 # or when using nix-shell:
44 # --argstr ccache_dir ~/.ccache
46 # and make sure the given directory is writable by the nixpkgs group when using nix-build or nix-env -i,
47 # or the current user when using nix-shell
56 syspkgs = import <nixpkgs> { };
57 pinpkgs = syspkgs.fetchFromGitHub {
61 # binary cache exists for revisions in https://nixos.org/releases/nixos/<release>/<build>/git-revision
62 rev = "c4469edac1fc1fa5e5b5aa2ceadeda8f3f92d30a"; # https://nixos.org/releases/nixos/16.09/nixos-16.09beta430.c4469ed/git-revision
63 sha256 = "1x6hmf815d5anfxrxl6iivfkk60q5qxa6waa9xnwhwkbc14rhvn9";
65 usepkgs = if null == pkgs then
72 stdenv = usepkgs.stdenvAdapters.keepDebugInfo usepkgs.stdenv;
74 in with usepkgs; stdenv.mkDerivation rec {
79 makeWrapper pkgconfig autoconf automake ccache
80 adns curl gettext gmp gnutls gss ncurses openldap zlib sqlite mariadb postgresql
81 libextractor libgcrypt libgnurl libidn libmicrohttpd
82 libpsl libtool libunistring libxml2
86 test -e Makefile && make distclean
89 NIX_CFLAGS_COMPILE = "-ggdb -O0";
92 "--enable-gcc-hardening"
93 "--enable-linker-hardening"
95 "--enable-experimental"
96 "--enable-logging=verbose"
102 configureFlags="$configureFlags --with-nssdir=$out/lib"
104 if [ -n "${ccache_dir}" ]; then
105 export CC='ccache gcc'
106 export CCACHE_COMPRESS=1
107 export CCACHE_DIR="${ccache_dir}"
108 export CCACHE_UMASK=007
115 # Tests can be run this way
116 #export GNUNET_PREFIX="$out"
117 #export PATH="$out/bin:$PATH"
121 meta = with stdenv.lib; {
122 description = "GNU's decentralized anonymous and censorship-resistant P2P framework";
125 GNUnet is a framework for secure peer-to-peer networking that
126 does not use any centralized or otherwise trusted services. A
127 first service implemented on top of the networking layer
128 allows anonymous censorship-resistant file-sharing. Anonymity
129 is provided by making messages originating from a peer
130 indistinguishable from messages that the peer is routing. All
131 peers act as routers and use link-encrypted connections with
132 stable bandwidth utilization to communicate with each other.
133 GNUnet uses a simple, excess-based economic model to allocate
134 resources. Peers in GNUnet monitor each others behavior with
135 respect to resource usage; peers that contribute to the
136 network are rewarded with better service.
139 homepage = http://gnunet.org/;
141 license = licenses.gpl3Plus;
142 platforms = platforms.gnu;
143 maintainers = with maintainers; [ ];