@@ -19,16 +19,32 @@ fold_end() {
19
19
echo -e " travis_fold:end:$key \e[2K"
20
20
}
21
21
22
+ cached_download () {
23
+ file=$1
24
+ url=$2
25
+ shasum=$3
26
+ path=" $HOME /Downloads/$file "
27
+ if [[ ! -f " $path "
28
+ || " $( shasum -a 256 " $HOME /Downloads/$file " | awk ' {print $1}' ) " != " $shasum " ]]
29
+ then
30
+ curl -L -o " $path " " $url "
31
+ fi
32
+ }
33
+
22
34
fold_start Python " Install Python 3.8 from python.org"
23
- curl -O https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg
24
- sudo installer -package python-3.8.5-macosx10.9.pkg -target /
35
+ cached_download python-3.8.5-macosx10.9.pkg \
36
+ https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg \
37
+ e27c5a510c10f830084fb9c60b9e9aa8719d92e4537a80e6b4252c02396f0d29
38
+ sudo installer -package " $HOME " /Downloads/python-3.8.5-macosx10.9.pkg -target /
25
39
sudo ln -s /usr/local/bin/python3 /usr/local/bin/python
26
40
hash -r
27
41
fold_end Python
28
42
29
43
fold_start ccache ' Install ccache (compile it ourselves)'
30
- curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz
31
- tar xf ccache-3.7.11.tar.xz
44
+ cached_download ccache-3.7.11.tar.xz \
45
+ https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz \
46
+ 8d450208099a4d202bd7df87caaec81baee20ce9dd62da91e9ea7b95a9072f68
47
+ tar xf " $HOME " /Downloads/ccache-3.7.11.tar.xz
32
48
pushd ccache-3.7.11
33
49
./configure --prefix=/usr/local
34
50
make
40
56
fold_end ccache
41
57
42
58
fold_start freetype ' Install freetype (just unpack into the build directory)'
43
- curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz
59
+ cached_download freetype-2.6.1.tar.gz \
60
+ https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz \
61
+ 0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014
44
62
mkdir -p build
45
- tar -x -C build -f freetype-2.6.1.tar.gz
63
+ tar -x -C build -f " $HOME " /Downloads/ freetype-2.6.1.tar.gz
46
64
fold_end freetype
0 commit comments