Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 2 | set -e |
| 3 | |
| 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 7 | set -x |
| 8 | |
| 9 | pushd "${CACHE_DIR:-/tmp}" >/dev/null |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 10 | |
| 11 | INSTALLED_VERSION= |
| 12 | if 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 |
| 19 | fi |
| 20 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame^] | 21 | if [[ -z $INSTALLED_VERSION ]]; then |
| 22 | INSTALLED_VERSION=$(git -C ChronoSync rev-parse HEAD 2>/dev/null || echo NONE) |
| 23 | fi |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 24 | |
| 25 | sudo rm -Rf ChronoSync-latest |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 26 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame^] | 27 | git clone --depth 1 git://github.com/named-data/ChronoSync ChronoSync-latest |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 28 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame^] | 29 | LATEST_VERSION=$(git -C ChronoSync-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
| 30 | |
| 31 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 32 | sudo rm -Rf ChronoSync |
| 33 | mv ChronoSync-latest ChronoSync |
| 34 | else |
| 35 | sudo rm -Rf ChronoSync-latest |
| 36 | fi |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 37 | |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 38 | sudo rm -fr /usr/local/include/ChronoSync |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 39 | sudo rm -f /usr/local/lib/libChronoSync* |
| 40 | sudo rm -f /usr/local/lib/pkgconfig/ChronoSync* |
| 41 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame^] | 42 | pushd ChronoSync >/dev/null |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 43 | |
| 44 | if has FreeBSD10 $NODE_LABELS; then |
| 45 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ |
| 46 | fi |
| 47 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 48 | ./waf configure --color=yes |
| 49 | ./waf build --color=yes -j${WAF_JOBS:-1} |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 50 | sudo env "PATH=$PATH" ./waf install --color=yes |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 51 | |
| 52 | popd >/dev/null |
| 53 | popd >/dev/null |
| 54 | |
| 55 | if has Linux $NODE_LABELS; then |
| 56 | sudo ldconfig |
| 57 | elif has FreeBSD10 $NODE_LABELS; then |
| 58 | sudo ldconfig -m |
| 59 | fi |