summaryrefslogtreecommitdiff
path: root/travis/build-dep-zstd
blob: 8996f4a2a97d799c195400e10fa56181609b485c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# download, build and install the zstd library

version=1.3.7
dir=tmp-cached-zstd
stamp="$dir/.last-build-zstd"
here=`pwd`

set -e

if [ -d "$dir" -a -f "$stamp" ]; then
	echo "Using valid cache for $dir, built" `cat "$stamp"`
	cd "$dir"
	cd zstd-${version}
	sudo make install PREFIX=/usr
	exit 0
fi

echo "No or stale cache for $dir, rebuilding"
rm -rf "$dir"
mkdir "$dir"
cd "$dir"
wget https://github.com/facebook/zstd/archive/v${version}.tar.gz
tar xf v${version}.tar.gz
cd zstd-${version}
make
sudo make install PREFIX=/usr
date > "$here/$stamp"