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 | |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 21 | # if [[ -z $INSTALLED_VERSION ]]; then |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame^] | 22 | # INSTALLED_VERSION=$(git -C ChronoSync rev-parse HEAD 2>/dev/null || echo NONE) |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 23 | # fi |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 24 | |
| 25 | sudo rm -Rf ChronoSync-latest |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 26 | ## Remove line when #3920 and #4119 merge. |
Nick Gordon | b9e2c65 | 2017-06-20 13:37:55 -0500 | [diff] [blame] | 27 | sudo rm -rf ChronoSync-hotfix |
| 28 | git clone git://github.com/named-data/ChronoSync ChronoSync-hotfix |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 29 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame^] | 30 | # LATEST_VERSION=$(git -C ChronoSync-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 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 | |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 39 | sudo rm -fr /usr/local/include/ChronoSync |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 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 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame^] | 50 | ./waf configure --color=yes |
| 51 | ./waf build --color=yes -j${WAF_JOBS:-1} |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 52 | sudo env "PATH=$PATH" ./waf install --color=yes |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 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 |