From 728361831291e34dfd4f1c1b64c4ce10e60933ba Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Mon, 13 Feb 2017 21:44:38 +0100 Subject: [PATCH] Install libsodium automatically --- .gitignore | 1 + .travis.yml | 1 + Makefile | 19 +++++++++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a516f4d..d73814f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ tests/spec/suite *.pyc local data +libsodium diff --git a/.travis.yml b/.travis.yml index 190b87f..7557ef3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ env: install: # remotestorage testsuite only runs on rubby 2 - rvm use 2 + - make libsodium - make install-$BUILD script: diff --git a/Makefile b/Makefile index 2df1112..db3006f 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +current_dir = $(shell pwd) +export SODIUM_LIB_DIR := $(current_dir)/local/lib/ +export SODIUM_STATIC := yes + export RUST_BACKTRACE := 1 SPEC_TEST_DIR=tests/spec @@ -6,7 +10,7 @@ APP_BINARY=./target/debug/mysteryshack TEST_CMD=$(APP_BINARY) -c $(TMP_DIR)/config PROXY_SERVERS=false -all: +all: libsodium $(MAKE) release-build release-build: @@ -79,4 +83,15 @@ install-unittest: unittest: cargo test -.PHONY: test +libsodium: + [ -d libsodium ] || git clone https://github.com/jedisct1/libsodium libsodium + set -ex && cd libsodium && \ + git fetch && \ + git checkout origin/stable && \ + rm -rf lib && \ + ./autogen.sh && \ + ./configure --prefix=$$PWD/../local/ --disable-shared && \ + $(MAKE) && \ + $(MAKE) install + +.PHONY: test libsodium