MacPorts is needed to install some compile-time dependencies.
Install MacPorts according to the instructions found here.
Ensure that Macports' binary paths (
/opt/local/sbin) are in your
PATH environment variable.
# general sudo port install mercurial # YML2 sudo port install py27-lxml # libetpan sudo port install git autoconf automake libtool # asn1c sudo port install asn1c # engine sudo port install gpgme
python is Python 2.7:
sudo port select python python27
mkdir -p ~/code/yml2 hg clone https://cacert.pep.foundation/dev/repos/yml2/ ~/code/yml2
pEp Engine requires libetpan with a set of patches that have not been upstreamed yet.
mkdir -p ~/code/libetpan git clone https://github.com/fdik/libetpan ~/code/libetpan cd ~/code/libetpan mkdir ~/code/libetpan/build ./autogen.sh --prefix="$HOME/code/libetpan/build" make make install
The MacPorts-packaged GPGME links to a version of GNU libiconv that has files in the same include/library paths as GPGME. This version of libiconv must not be visible to the linker when the pEp Engine is build or run.
Thus the files of the GPGME distribution will have to be manually copied to separate include/library folders, so that no include or library paths used for building the pEp Engine contains files of MacPorts' libiconv distribution.
mkdir -p ~/code/gpgme/build/include cp /opt/local/include/gpg*.h ~/code/gpgme/build/include mkdir -p ~/code/gpgme/build/lib cp -r /opt/local/lib/libgpg* ~/code/gpgme/build/lib
It's of course possible to skip MacPort's version, and use a self-compiled GPGME/GPG. The default build configuration assumes this case, and assumes you have installed your GPGME with
$(HOME) as your prefix.
mkdir -p ~/code/pep-engine hg clone https://cacert.pep.foundation/dev/repos/pEpEngine/ ~/code/pep-engine cd ~/code/pep-engine mkdir ~/code/pep-engine/build
Note: Everything PLATFORM_OVERRIDE-related is currenty outdated. Do not rely on the documentation here!
Note: Everything Makefile.conf-related is currenty outdated. Do not rely on the documentation here!
For an explanation of the mechanics of
PLATFORM_OVERRIDE, see the inline comments in
In this guide, the platform-specific configuration will be called
The installation directory will be a subdirectory of the repository.
This is useful for testing only.
PREFIX=$(HOME)/code/pep-engine/build SYSTEM_DB=$(PREFIX)/share/pEp/system.db YML2_PATH=$(HOME)/code/yml2 ETPAN_LIB=-L$(HOME)/code/libetpan/build/lib ETPAN_INC=-I$(HOME)/code/libetpan/build/include GPGME_LIB=-L$(HOME)/code/gpgme/build/lib GPGME_INC=-I$(HOME)/code/gpgme/build/include
The engine is built as follows:
make all make db
If your build fails with an error message similar to the following:
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 477, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8
or any other locale-related Python error, make sure Python does not have any locale-related environment variables set.
unset LC_CTYPE is sufficient to take care of the problem, but it depends on your macOS's regional and language settings and which terminal emulator you use.
This is a bug in Python, see https://bugs.python.org/issue18378#msg215215.
The unit tests can be run without the engine library being installed, however
system.db must be installed:
make -C db install
system.db rarely changes, its installation is not needed for every build.
Tests can be compiled and executed with the following commands:
make -C test compile make test