blob: aa8c8751baba8858c845578a7323c6a9e9022cee [file] [log] [blame]
Ashlesh Gawande415676b2016-12-22 00:26:23 -06001#!/usr/bin/env bash
Ashlesh Gawande415676b2016-12-22 00:26:23 -06002set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Davide Pesavento813df802017-08-20 20:53:54 -04007set -x
8
9pushd "${CACHE_DIR:-/tmp}" >/dev/null
Ashlesh Gawande415676b2016-12-22 00:26:23 -060010
11INSTALLED_VERSION=
12if has OSX $NODE_LABELS; then
13 BOOST=$(brew ls --versions boost)
14 OLD_BOOST=$(cat boost_chrono.txt || :)
15 if [[ $OLD_BOOST != $BOOST ]]; then
16 echo "$BOOST" > boost_chrono.txt
17 INSTALLED_VERSION=NONE
18 fi
19fi
20
Nick Gordonb9c5cec2017-06-08 14:10:27 -050021# if [[ -z $INSTALLED_VERSION ]]; then
Davide Pesavento813df802017-08-20 20:53:54 -040022# INSTALLED_VERSION=$(git -C ChronoSync rev-parse HEAD 2>/dev/null || echo NONE)
Nick Gordonb9c5cec2017-06-08 14:10:27 -050023# fi
Ashlesh Gawande415676b2016-12-22 00:26:23 -060024
25sudo rm -Rf ChronoSync-latest
Nick Gordonb9c5cec2017-06-08 14:10:27 -050026## Remove line when #3920 and #4119 merge.
Nick Gordonb9e2c652017-06-20 13:37:55 -050027sudo rm -rf ChronoSync-hotfix
28git clone git://github.com/named-data/ChronoSync ChronoSync-hotfix
Ashlesh Gawande415676b2016-12-22 00:26:23 -060029
Davide Pesavento813df802017-08-20 20:53:54 -040030# LATEST_VERSION=$(git -C ChronoSync-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
Nick Gordonb9c5cec2017-06-08 14:10:27 -050031
32# if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
33# sudo rm -Rf ChronoSync
34# mv ChronoSync-latest ChronoSync
35# else
36# sudo rm -Rf ChronoSync-latest
37# fi
38
Davide Pesavento6a81b772017-08-20 18:43:46 -040039sudo rm -fr /usr/local/include/ChronoSync
Ashlesh Gawande415676b2016-12-22 00:26:23 -060040sudo rm -f /usr/local/lib/libChronoSync*
41sudo rm -f /usr/local/lib/pkgconfig/ChronoSync*
42
Nick Gordonb9c5cec2017-06-08 14:10:27 -050043pushd ChronoSync-hotfix >/dev/null
44git checkout 097bb448f46b8bd9a5c1f431e824f8f6a169b650
Ashlesh Gawande415676b2016-12-22 00:26:23 -060045
46if has FreeBSD10 $NODE_LABELS; then
47 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
48fi
49
Davide Pesavento813df802017-08-20 20:53:54 -040050./waf configure --color=yes
51./waf build --color=yes -j${WAF_JOBS:-1}
Davide Pesavento6a81b772017-08-20 18:43:46 -040052sudo env "PATH=$PATH" ./waf install --color=yes
Ashlesh Gawande415676b2016-12-22 00:26:23 -060053
54popd >/dev/null
55popd >/dev/null
56
57if has Linux $NODE_LABELS; then
58 sudo ldconfig
59elif has FreeBSD10 $NODE_LABELS; then
60 sudo ldconfig -m
61fi