Building and Installing

First, download latest Themis version

git fetch https://github.com/cossacklabs/themis.wiki.git

In most cases, going to Themis source directory and typing

make install

should work for you.

Makefile parameters

Themis comes with a makefile, which should serve you in most cases well. There is not enough specific interaction to do a ./configure scenario. Everything comes prepared in advance!

Makefile includes targets: - themis_shared: build only shared themis library - themis_static: build only static themis library - test_all: build test for themis - all: build both - shared and static themis libraries - install: build and install necessary headers and libraries in system.

The default makefile is configured to build both static and shared libraries. Libraries build in release mode by default. To build THEMIS in debug mode with debug symbols on make stage you need to set variable DEBUG:

make DEBUG=yes

LibreSSL / OpenSSL

Themis uses LibreSSL/OpenSSL engine libcrypto as a dependency right now. In future, we plan to broaden the support of different crypto implementation libraries (and, in some rare cases, provide our own).

You need to install both engine and it's development header files. By default, Themis will build with system default libcrypto. If you need to use custom one, set two parameters:

You can do this via:

make CRYPTO_ENGINE_INCLUDE_PATH=/opt/include CRYPTO_ENGINE_LIB_PATH=/opt/lib

Custom destinations

By default THEMIS is installed to /usr/lib and /usr/include folder. To change prefix of target folders use parameter PREFIX:

make install PREFIX=/opt

Directory Structure

After the installation, a typical directory structure would look like:

- /usr/include/
-- soter - THEMIS header files for soter subsystem
-- themis - THEMIS header files
- /usr/lib
-- libthemis.a, libthemis.so, libsoter.a, libsoter.so - compiled libraries

Installing Themis wrappers

Installing language-specific wrappers is done after you've installed the main library itself.

Python

Just type

pip install pythemis

PHP

In Themis source directory, type:

make phpthemis_install

this will build phpthemis.so extension for php. Now add

extension=phpthemis.so

to php.ini.

Ruby

If Themis is already installed, type in console:

 sudo gem install rubythemis

To install both Themis and rubythemis wrapper, go to Themis root directory and type

make rubythemis_install

Android

Themis for Android uses Gradle build system.

You should install latest gradle, Android SDK and Android NDK.

Next, specify paths to your SDK and NDK for gradle:

export ANDROID_SDK=/path/to/android/sdk
export ANDROID_NDK_ROOT=/path/to/android/ndk

Finally, build Themis (both Java and Native part):

gradle build

It will build AAR (Android library project) ready to be used in your application. If you want to use SecureSocket and SecureServerSocket classes, make sure you have declared INTERNET permission in your AndroidManifest.xml.

To run Android tests connect your device(s) and run (make sure ADB is enabled in settings):

gradle connectedAndroidTest

iOS/OSX

Themis for iOS/OSX uses Cocoapods dependency manager.

To add Themis support to your XCode project just add next line to Podfile

pod 'themis'

and run

pod install