Cache compiled packages on travis.

master
Didactic Drunk 2019-06-25 13:35:15 -07:00
parent d907317fd4
commit 1f6446b6f5
2 changed files with 40 additions and 7 deletions

View File

@ -1,6 +1,27 @@
sudo: true
language: crystal
os:
- linux
# - osx
install:
- ./travis-install-lib-sodium.sh
before_script:
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
- export C_INCLUDE_PATH=$LD_LIBRARY_PATH:`pwd`/sodium/include
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/sodium/lib
- env | egrep PKG
- export PKG_CONFIG_PATH=`pwd`/sodium/lib/pkgconfig
- env | egrep LD_
- env | egrep PKG
- pwd
cache:
directories:
- sodium
#addons:
# apt:
# packages:
# - libsodium-dev # old
# homebrew:
# packages:
# - libsodium # takes forever

View File

@ -5,9 +5,21 @@
set -e
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar xvfz LATEST.tar.gz
cd libsodium-stable
sudo ./configure
sudo make
sudo make install
LIBSODIUM_INSTALL_PATH=`pwd`/sodium
if [ ! -f "sodium/include/sodium.h" ]; then
set -x
mkdir -p "$LIBSODIUM_INSTALL_PATH"
find "$LIBSODIUM_INSTALL_PATH"
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar xfz LATEST.tar.gz
cd libsodium-stable
./configure --prefix="$LIBSODIUM_INSTALL_PATH"
make
make install
else
echo "using cached libsodium build"
find "$LIBSODIUM_INSTALL_PATH"
fi