Commit bbae5d0f authored by Luca Boccassi's avatar Luca Boccassi

Problem: dpkg-query might fail in CI build and fail the build

Solution: rework the bash test to avoid build failures as intended
and make it an easier one-liner
parent b2a2bb86
......@@ -23,16 +23,8 @@ if [ -z $CURVE ]; then
elif [ $CURVE == "libsodium" ]; then
CMAKE_OPTS+=("-DWITH_LIBSODIUM=ON")
if command -v dpkg-query >/dev/null 2>&1; then
dpkg-query --list libsodium-dev >/dev/null 2>&1
HAVE_SODIUM=$?
elif command -v brew >/dev/null 2>&1; then
brew ls --versions libsodium >/dev/null 2>&1
HAVE_SODIUM=$?
else
HAVE_SODIUM=1
fi
if [ $HAVE_SODIUM -ne 0 ]; then
if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libsodium-dev >/dev/null 2>&1) || \
(command -v brew >/dev/null 2>&1 && brew ls --versions libsodium >/dev/null 2>&1)); then
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
......
......@@ -19,16 +19,8 @@ if [ -z $CURVE ]; then
elif [ $CURVE == "libsodium" ]; then
CMAKE_OPTS+=("-DWITH_LIBSODIUM=ON")
if command -v dpkg-query >/dev/null 2>&1; then
dpkg-query --list libsodium-dev >/dev/null 2>&1
HAVE_SODIUM=$?
elif command -v brew >/dev/null 2>&1; then
brew ls --versions libsodium >/dev/null 2>&1
HAVE_SODIUM=$?
else
HAVE_SODIUM=1
fi
if [ $HAVE_SODIUM -ne 0 ]; then
if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libsodium-dev >/dev/null 2>&1) || \
(command -v brew >/dev/null 2>&1 && brew ls --versions libsodium >/dev/null 2>&1)); then
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
......
......@@ -19,16 +19,8 @@ if [ -z $CURVE ]; then
elif [ $CURVE == "libsodium" ]; then
CONFIG_OPTS+=("--with-libsodium=yes")
if command -v dpkg-query >/dev/null 2>&1; then
dpkg-query --list libsodium-dev >/dev/null 2>&1
HAVE_SODIUM=$?
elif command -v brew >/dev/null 2>&1; then
brew ls --versions libsodium >/dev/null 2>&1
HAVE_SODIUM=$?
else
HAVE_SODIUM=1
fi
if [ $HAVE_SODIUM -ne 0 ]; then
if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libsodium-dev >/dev/null 2>&1) || \
(command -v brew >/dev/null 2>&1 && brew ls --versions libsodium >/dev/null 2>&1)); then
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
......
......@@ -20,16 +20,8 @@ if [ $BUILD_TYPE == "default" ]; then
elif [ $CURVE == "libsodium" ]; then
CONFIG_OPTS+=("--with-libsodium=yes")
if command -v dpkg-query >/dev/null 2>&1; then
dpkg-query --list libsodium-dev >/dev/null 2>&1
HAVE_SODIUM=$?
elif command -v brew >/dev/null 2>&1; then
brew ls --versions libsodium >/dev/null 2>&1
HAVE_SODIUM=$?
else
HAVE_SODIUM=1
fi
if [ $HAVE_SODIUM -ne 0 ]; then
if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libsodium-dev >/dev/null 2>&1) || \
(command -v brew >/dev/null 2>&1 && brew ls --versions libsodium >/dev/null 2>&1)); then
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment