Cache compiled packages on travis.

This commit is contained in:
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 sudo: true
language: crystal language: crystal
os:
- linux
# - osx
install: install:
- ./travis-install-lib-sodium.sh - ./travis-install-lib-sodium.sh
before_script: 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 set -e
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 wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar xvfz LATEST.tar.gz tar xfz LATEST.tar.gz
cd libsodium-stable cd libsodium-stable
sudo ./configure ./configure --prefix="$LIBSODIUM_INSTALL_PATH"
sudo make make
sudo make install make install
else
echo "using cached libsodium build"
find "$LIBSODIUM_INSTALL_PATH"
fi