{% extends "common/base.j2" %} {% block body_content %}

{{ _("Tutorial: GNUnet on macOS 10.14 (Mojave)") }}

{{ _("Introduction") }}

Welcome to the hopefully painless GNUnet tutorial for macOS Mojave! It provides concrete instructions on how to compile, install and configure a current version of GNUnet. The goal is to support newcomers, either end users or developers, who want to get in touch with GNUnet for the first time. After installing GNUnet we will make sure that out new GNUnet installation is working correctly.

{{ _("Requirements") }}

First, install homebrew and XCode. Then install the following packages:

$ sudo brew install git autoconf automake glpk gettext gnutls jansson libextractor libgcrypt libffi libidn2 libmicrohttpd libmpc libtool libunistring pkg-config unbound

{{ _("Make an installation directory") }}

Next we create a directory in our home directory where we store the source code later. We should keep this directory after installation because it contains Makefiles that can be used for uninstalling GNUnet again (see chapter *Uninstall GNUnet and its dependencies*).

$ mkdir ~/gnunet

{{ _("Get the source code") }}

$ cd ~
$ git clone --depth 1 https://gnunet.org/git/gnunet.git gnunet_src

In order to have a gnutls with DANE support, you need to edit the formula:

$ brew edit gnutls

Add the line "depends_on 'unbound'" to the dependencies in the formula. Then in the install function before the configure add:

ENV['CFLAGS']='-I/usr/local/Cellar/unbound/1.9.0/include'
ENV['LDFLAGS']='-L/usr/local/Cellar/unbound/1.9.0/lib'

Reinstall gnutls from source:

$ brew reinstall -s gnutls

{{ _("Compile and Install") }}

We have two options: installing a *production version* and installing a *development version*. If you want to start writing GNUnet applications or join the GNUnet development choose the development version (it will print more debug output and contains debug symbols that can be displayed with a debugger). Otherwise choose the production version.

{{ _("Option 1: GNUnet for production / usage") }}

$ cd ~/gnunet_src
$ ./bootstrap
$ export GNUNET_PREFIX=~/gnunet
$ ./configure --prefix=$GNUNET_PREFIX --disable-documentation

You might see configure failing telling you that it ``cannot run C compiled programs.''. In this case, you might need to open/run Xcode once and you will be prompted to install additonal packages. Then, you might have to manually install the command line tools from here https://developer.apple.com/download/more/ (you need an Apple ID for this). Install those and execute

$ open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

After configure passes, you need to add a 'gnunetdns' group using the macOS system preferences. Further, you need to add a user 'gnunet'. Then:

$ make
$ sudo make install

{{ _("Option 2: GNUnet for development") }}

Perform the same steps as for Option 1, but add the configure flat '--enable-experimental'

{% endblock body_content %}