Skip to content

Commit

Permalink
Merge pull request #1797 from bluca/ci_matrix
Browse files Browse the repository at this point in the history
Problem: CI use of sodium or nacl is confusing
  • Loading branch information
jemc committed Feb 11, 2016
2 parents 05f382d + 9393f06 commit 781ddd6
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 44 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Expand Up @@ -7,9 +7,14 @@ os:
- osx

env:
- BUILD_TYPE=default CURVE=libsodium
- BUILD_TYPE=android CURVE=libsodium
- BUILD_TYPE=cmake CURVE=libsodium
- BUILD_TYPE=default CURVE=tweetnacl
- BUILD_TYPE=android CURVE=tweetnacl
- BUILD_TYPE=cmake CURVE=tweetnacl
- BUILD_TYPE=default
- BUILD_TYPE=android
- BUILD_TYPE=libsodium
- BUILD_TYPE=cmake

sudo: false
Expand Down
37 changes: 24 additions & 13 deletions builds/android/build.sh
Expand Up @@ -25,35 +25,46 @@ if [[ $ANDROID_BUILD_CLEAN ]]; then
rm -rf "${ANDROID_BUILD_PREFIX}"/*
fi

##
# Build libsodium from latest master branch
if [ -z $CURVE ]; then
CURVE="--disable-curve"
VERIFY="libzmq.so"
elif [ $CURVE == "libsodium" ]; then
CURVE="--with-libsodium=yes"
VERIFY="libzmq.so libsodium.so"
##
# Build libsodium from latest master branch

(android_build_verify_so "libsodium.so" &> /dev/null) || {
rm -rf "${cache}/libsodium"
(cd "${cache}" && git clone -b stable --depth 1 git://github.com/jedisct1/libsodium.git) || exit 1
(cd "${cache}/libsodium" && ./autogen.sh \
&& ./configure --quiet "${ANDROID_BUILD_OPTS[@]}" --disable-soname-versions \
&& make -j 4 \
&& make install) || exit 1
}
(android_build_verify_so "libsodium.so" &> /dev/null) || {
rm -rf "${cache}/libsodium"
(cd "${cache}" && git clone -b stable --depth 1 git://github.com/jedisct1/libsodium.git) || exit 1
(cd "${cache}/libsodium" && ./autogen.sh \
&& ./configure --quiet "${ANDROID_BUILD_OPTS[@]}" --disable-soname-versions \
&& make -j 4 \
&& make install) || exit 1
}
elif [ $CURVE == "tweetnacl" ]; then
# Default
CURVE=""
VERIFY="libzmq.so"
fi

##
# Build libzmq from local source

LIBTOOL_EXTRA_LDFLAGS='-avoid-version'

(android_build_verify_so "libzmq.so" "libsodium.so" &> /dev/null) || {
(android_build_verify_so ${VERIFY} &> /dev/null) || {
rm -rf "${cache}/libzmq"
(cp -r ../.. "${cache}/libzmq" && cd "${cache}/libzmq" && make clean)

(cd "${cache}/libzmq" && ./autogen.sh \
&& ./configure --quiet "${ANDROID_BUILD_OPTS[@]}" --without-docs --with-libsodium=yes \
&& ./configure --quiet "${ANDROID_BUILD_OPTS[@]}" ${CURVE} --without-docs \
&& make -j 4 \
&& make install) || exit 1
}

##
# Verify shared libraries in prefix

android_build_verify_so "libzmq.so" "libsodium.so"
android_build_verify_so ${VERIFY}
echo "libzmq android build succeeded"
9 changes: 9 additions & 0 deletions builds/cmake/ci_build.sh
Expand Up @@ -18,5 +18,14 @@ CMAKE_OPTS+=("-DCMAKE_PREFIX_PATH:PATH=${BUILD_PREFIX}")
CMAKE_OPTS+=("-DCMAKE_LIBRARY_PATH:PATH=${BUILD_PREFIX}/lib")
CMAKE_OPTS+=("-DCMAKE_INCLUDE_PATH:PATH=${BUILD_PREFIX}/include")

if [ -z $CURVE ]; then
CMAKE_OPTS+=("-DENABLE_CURVE=OFF")
elif [ $CURVE == "libsodium" ]; then
CMAKE_OPTS+=("-DWITH_LIBSODIUM=ON")

git clone --depth 1 -b stable git://github.com/jedisct1/libsodium.git
( cd libsodium; ./autogen.sh; ./configure --prefix=$BUILD_PREFIX; make install)
fi

# Build, check, and install from local source
( cd ../..; mkdir build_cmake && cd build_cmake && PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig cmake "${CMAKE_OPTS[@]}" .. && make all VERBOSE=1 && make install ) || exit 1
30 changes: 0 additions & 30 deletions builds/libsodium/ci_build.sh

This file was deleted.

9 changes: 9 additions & 0 deletions ci_build.sh
Expand Up @@ -14,6 +14,15 @@ if [ $BUILD_TYPE == "default" ]; then
CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig")
CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}")

if [ -z $CURVE ]; then
CONFIG_OPTS+=("--disable-curve")
elif [ $CURVE == "libsodium" ]; then
CONFIG_OPTS+=("--with-libsodium=yes")

git clone --depth 1 -b stable git://github.com/jedisct1/libsodium.git
( cd libsodium; ./autogen.sh; ./configure --prefix=$BUILD_PREFIX; make check; make install)
fi

# Build and check this project
(
./autogen.sh &&
Expand Down

0 comments on commit 781ddd6

Please sign in to comment.