Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 2 | set -e |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 3 | |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 7 | set -x |
| 8 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame^] | 9 | pushd "${CACHE_DIR:-/tmp}" >/dev/null |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 10 | |
Ashlesh Gawande | 812af97 | 2017-04-21 09:26:37 -0500 | [diff] [blame] | 11 | INSTALLED_VERSION= |
| 12 | if has OSX $NODE_LABELS; then |
| 13 | BOOST=$(brew ls --versions boost) |
| 14 | OLD_BOOST=$(cat boost.txt || :) |
| 15 | if [[ $OLD_BOOST != $BOOST ]]; then |
| 16 | echo "$BOOST" > boost.txt |
| 17 | INSTALLED_VERSION=NONE |
| 18 | fi |
| 19 | fi |
| 20 | |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 21 | ## Uncomment when #3920 and #4119 merge. |
| 22 | # if [[ -z $INSTALLED_VERSION ]]; then |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame^] | 23 | # INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE) |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 24 | # fi |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 25 | |
Muktadir R Chowdhury | 4c7caad | 2015-09-03 15:49:22 -0500 | [diff] [blame] | 26 | sudo rm -Rf ndn-cxx-latest |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 27 | ## Remove this when #3920 and #4119 merge |
Nick Gordon | a75fdb2 | 2017-07-06 14:10:43 -0500 | [diff] [blame] | 28 | sudo rm -Rf ndn-cxx-hotfix |
| 29 | git clone git://github.com/named-data/ndn-cxx ndn-cxx-hotfix |
| 30 | |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 31 | ## Uncomment when #3920 and #4119 merge. |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame^] | 32 | # LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 33 | |
| 34 | # if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 35 | # sudo rm -Rf ndn-cxx |
| 36 | # mv ndn-cxx-latest ndn-cxx |
| 37 | # cp ndn-cxx ndn-cxx-hotfix |
| 38 | # else |
| 39 | # sudo rm -Rf ndn-cxx-latest |
| 40 | # fi |
| 41 | |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 42 | sudo rm -f /usr/local/bin/ndnsec* |
| 43 | sudo rm -fr /usr/local/include/ndn-cxx |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 44 | sudo rm -f /usr/local/lib/libndn-cxx* |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 45 | sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx.pc |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 46 | |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 47 | ## Change to the hotfix directory instead of the normal ndn-cxx directory |
| 48 | ## Restore below line when #3920 and #4119 merge. |
| 49 | #pushd ndn-cxx >/dev/null |
| 50 | pushd ndn-cxx-hotfix >/dev/null |
| 51 | git checkout b555b00c280b9c9ed46f24a1fbebc73b720601af |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 52 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame^] | 53 | ./waf configure --color=yes --enable-shared --disable-static --without-osx-keychain |
| 54 | ./waf build --color=yes -j${WAF_JOBS:-1} |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 55 | sudo env "PATH=$PATH" ./waf install --color=yes |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 56 | |
| 57 | popd >/dev/null |
| 58 | popd >/dev/null |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 59 | |
| 60 | if has Linux $NODE_LABELS; then |
| 61 | sudo ldconfig |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 62 | elif has FreeBSD10 $NODE_LABELS; then |
| 63 | sudo ldconfig -m |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 64 | fi |