Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
| 5 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 6 | source "$JDIR"/util.sh |
| 7 | |
| 8 | pushd /tmp >/dev/null |
| 9 | |
| 10 | INSTALLED_VERSION= |
| 11 | if has OSX $NODE_LABELS; then |
| 12 | BOOST=$(brew ls --versions boost) |
| 13 | OLD_BOOST=$(cat boost_chrono.txt || :) |
| 14 | if [[ $OLD_BOOST != $BOOST ]]; then |
| 15 | echo "$BOOST" > boost_chrono.txt |
| 16 | INSTALLED_VERSION=NONE |
| 17 | fi |
| 18 | fi |
| 19 | |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame^] | 20 | # if [[ -z $INSTALLED_VERSION ]]; then |
| 21 | # INSTALLED_VERSION=$((cd ChronoSync && git rev-parse HEAD) 2>/dev/null || echo NONE) |
| 22 | # fi |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 23 | |
| 24 | sudo rm -Rf ChronoSync-latest |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame^] | 25 | ## Remove line when #3920 and #4119 merge. |
| 26 | if [ ! -d "ChronoSync-hotfix" ]; then |
| 27 | git clone git://github.com/named-data/ChronoSync ChronoSync-hotfix |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 28 | fi |
| 29 | |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame^] | 30 | # LATEST_VERSION=$((cd ChronoSync-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN) |
| 31 | |
| 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 | |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 39 | sudo rm -Rf /usr/local/include/ChronoSync |
| 40 | sudo rm -f /usr/local/lib/libChronoSync* |
| 41 | sudo rm -f /usr/local/lib/pkgconfig/ChronoSync* |
| 42 | |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame^] | 43 | pushd ChronoSync-hotfix >/dev/null |
| 44 | git checkout 097bb448f46b8bd9a5c1f431e824f8f6a169b650 |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 45 | |
| 46 | if has FreeBSD10 $NODE_LABELS; then |
| 47 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ |
| 48 | fi |
| 49 | |
| 50 | ./waf -j1 --color=yes configure |
| 51 | ./waf -j1 --color=yes build |
| 52 | sudo ./waf install -j1 --color=yes |
| 53 | |
| 54 | popd >/dev/null |
| 55 | popd >/dev/null |
| 56 | |
| 57 | if has Linux $NODE_LABELS; then |
| 58 | sudo ldconfig |
| 59 | elif has FreeBSD10 $NODE_LABELS; then |
| 60 | sudo ldconfig -m |
| 61 | fi |