blob: b798776a56fd089db85d579d4828737eaa111fbe [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
Ashlesh Gawande05cb7282018-08-30 14:39:41 -050021NDN_CXX=$(ndnsec version)
22OLD_NDN_CXX=$(cat ndn_cxx_chrono.txt || :)
23if [[ $OLD_NDN_CXX != $NDN_CXX ]]; then
24 echo "$NDN_CXX" > ndn_cxx_chrono.txt
25 INSTALLED_VERSION=NONE
26fi
27
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -050028if [[ -z $INSTALLED_VERSION ]]; then
29 INSTALLED_VERSION=$(git -C ChronoSync rev-parse HEAD 2>/dev/null || echo NONE)
30fi
Ashlesh Gawande415676b2016-12-22 00:26:23 -060031
32sudo rm -Rf ChronoSync-latest
Ashlesh Gawande415676b2016-12-22 00:26:23 -060033
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -050034git clone --depth 1 git://github.com/named-data/ChronoSync ChronoSync-latest
Nick Gordonb9c5cec2017-06-08 14:10:27 -050035
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -050036LATEST_VERSION=$(git -C ChronoSync-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
37
38if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
39 sudo rm -Rf ChronoSync
40 mv ChronoSync-latest ChronoSync
41else
42 sudo rm -Rf ChronoSync-latest
43fi
Nick Gordonb9c5cec2017-06-08 14:10:27 -050044
Davide Pesavento6a81b772017-08-20 18:43:46 -040045sudo rm -fr /usr/local/include/ChronoSync
Ashlesh Gawande415676b2016-12-22 00:26:23 -060046sudo rm -f /usr/local/lib/libChronoSync*
47sudo rm -f /usr/local/lib/pkgconfig/ChronoSync*
48
Muktadir Chowdhuryf04f9892017-08-20 20:42:56 -050049pushd ChronoSync >/dev/null
Ashlesh Gawande415676b2016-12-22 00:26:23 -060050
51if has FreeBSD10 $NODE_LABELS; then
52 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
53fi
54
Davide Pesavento813df802017-08-20 20:53:54 -040055./waf configure --color=yes
56./waf build --color=yes -j${WAF_JOBS:-1}
Davide Pesavento6a81b772017-08-20 18:43:46 -040057sudo env "PATH=$PATH" ./waf install --color=yes
Ashlesh Gawande415676b2016-12-22 00:26:23 -060058
59popd >/dev/null
60popd >/dev/null
61
62if has Linux $NODE_LABELS; then
63 sudo ldconfig
64elif has FreeBSD10 $NODE_LABELS; then
65 sudo ldconfig -m
66fi