Common Adapter Documentation/Adapter Build Instructions

Adapter Build Instructions

This document covers the whole download/build/install process for the whole pEp software stack on platforms:

  • Debian Linux (10/stable)
  • MacOS (>10.14)

Adapters included in this build are:

  • pEpJNIAdapter
  • pEpPythonAdapter

The prerequisite for this manual is a machine running Debian Linux 10 with standard system utilities installed.

About this document

This is work in progress, if you have any problems please get in touch with me via:

  • IRC pEp Intern: heck
  • Mail:

I depend on your feedback to improve this document and i will help you build your adapter. How to contribute:

  • Use the suggestions section in the appendix of this document
  • Change the document BUT mark your change, using “TODO:”
  • Ask me if you want to become a co-maintainer

As i am the maintainer of this document, please do not change this document in any other way.
If you are not working at pEp, please contact irc:// (please highlight sva)


Component Versions

Currently, if you follow these instructions, what will be built is just the very latest commit from each software repository. Please note that we use a repo “master/HEAD” is unstable policy. That means if you like to build a stable version of an adapter and its dependencies, you would need to build a released version of the adapter and its dependencies. But as of now, these instructions dont describe how to build specific versions of adapters/engine/etc.

Dir Layout

Currently, the instructions will only work using the following directory layout. These folder will be created while you cary out the instructions in this manual.

~/code        - source code main dir
~/code/common - shared source code, libs, etc...
~/include     - target install dir for header files
~/lib         - target install dir for libraries
~/bin         - target install dir for binaries
~/share       - target install dir for shared files

Installing System Dependencies

Debian Linux

As verified to work on Debian 10 (64bit) - minimal installation

Debian Packages

Prepare your linux system, by installing all these packages. Login as root, and execute the following line.

apt-get install sudo curl openssl libssl-dev pkg-config git capnproto clang sqlite3 libsqlite3-0 libsqlite3-dev python3 python3-lxml build-essential automake libtool autoconf make nettle-dev capnproto uuid-dev


Currently, in Debian10/stable the version of rust is too old. Please install rust Rust from (1.46 or later)


We need to configure sudo, so your normal user has sudo rights.
Login as root, and execute the following line, where has to be replaced with the username of your normal user.
Make sure to logout/login any session with the respective user, for the changes to become effective.

usermod -a -G sudo <USERNAME>


As verified to work on MacOS 10.14

sudo port install gnupg2 capnproto nettle pkgconfig coreutils libtool autoconf automake

Building Dependencies


The pEp engine is based on Sequoia as encryption backend, written in Rust.
Login as your normal user and execute the following lines to build and install Sequoia.

please note: the build might be taking some time, depending on your system

mkdir -p ~/code/common/sequoia
cd ~/code/common/sequoia
git clone .
git checkout pep-engine
make build-release PYTHON=disable
make install PYTHON=disable PREFIX=$HOME


Build and install YML2 (more info:

mkdir -p ~/code/common/yml2
cd ~/code/common/yml2
echo 'export PATH=$PATH:$HOME/code/common/yml2' >> ~/.bash_profile
source ~/.bash_profile
git clone .
git checkout 2.7.0


pEp Engine requires libetpan with a set of patches that have not been upstreamed yet.

mkdir -p ~/code/common/libetpan
cd ~/code/common/libetpan
git clone .
mkdir build
./ --prefix=$HOME
make install


Build and install ASN1c interface description language.

mkdir -p ~/code/common/asn1c
cd ~/code/common/asn1c
git clone git:// .
git checkout tags/v0.9.28 -b pep-engine
autoreconf -iv
./configure --prefix="$HOME"
make install

Building The pEpEngine

Download the engine source code.

mkdir -p ~/code/pEpEngine
cd ~/code/pEpEngine
git clone .

Create the build config file “local.conf” (paste the whole following code block into your shell)

echo '





export PKG_CONFIG_PATH=$(PREFIX)/share/pkgconfig/
' > local.conf

Build the engine

make install
make db dbinstall


Currently, we cant really “test” easily that the engine works, but lets check that the freshly built library is existing.

ls -l ~/lib/libpEpEngine*
-rwxr-xr-x 1 heck heck 1857744 Feb 24 23:59 /home/heck/lib/ (or .dylib on mac)

That looks good.

Building The Adapters

The build instructions for the various adapters follow here.
Login as normal user to execute those instructions.


libpEpAdapter is a static library containing common functionality that can be shared across adapters. Most adapters require libpEpAdapter.

mkdir -p ~/code/common/libpEpAdapter/
cd ~/code/common/libpEpAdapter/
git clone .
make install PREFIX=$HOME


This adapter requires libpEpAdapter, see build instructions above.

Dependencies Debian Linux

sudo apt-get install python3-setuptools libboost-python-dev libboost-locale1.67-dev

Dependencies MacOS

sudo port install boost


mkdir -p ~/code/pEpPythonAdapter/
cd ~/code/pEpPythonAdapter/
git clone .


make devenv
make envtest
*** init pEp 1.1.1 (null) (null)

That looks good


This adapter requires libpEpAdapter, see build instructions above.

Dependencies Debian Linux

sudo apt-get install default-jdk

Dependencies MacOS

sudo port install gsed


mkdir -p ~/code/pEpJNIAdapter/
cd ~/code/pEpJNIAdapter/
git clone .


cd test/java/foundation/pEp/jniadapter/test/basic

main      : ======== TEST: 'startSync()' ================================ CTX: 'BasicTestContext' ========= [0.100 sec] === SUCCESS ======
main      : ======== TEST: 'Keygen2' ==================================== CTX: 'BasicTestContext' ========= [0.106 sec] === SUCCESS ====== - called - sync_is_running - injecting null event

*** sync_protocol thread shutdown pEp sync protocol (null) (null)
Adapter.hxx::sync_thread - sync protocol loop ended
main      : ======== TEST: 'stopSync()' ================================= CTX: 'BasicTestContext' ========= [0.002 sec] === SUCCESS ======
main      : SUCCESS: 12
main      : FAILED : 0
main      : TOTAL  : 12

That looks good



Please add your suggestions after this line. Thanks a lot for your contribution.