Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame^] | 2 | set -ex |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 3 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame^] | 4 | pushd "$CACHE_DIR" >/dev/null |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 5 | |
Ashlesh Gawande | 6f6ef01 | 2017-05-11 16:05:40 +0000 | [diff] [blame] | 6 | INSTALLED_VERSION= |
| 7 | if has OSX $NODE_LABELS; then |
| 8 | BOOST=$(brew ls --versions boost) |
| 9 | OLD_BOOST=$(cat boost.txt || :) |
| 10 | if [[ $OLD_BOOST != $BOOST ]]; then |
| 11 | echo "$BOOST" > boost.txt |
| 12 | INSTALLED_VERSION=NONE |
| 13 | fi |
| 14 | fi |
| 15 | |
| 16 | if [[ -z $INSTALLED_VERSION ]]; then |
| 17 | INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE) |
| 18 | fi |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 19 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame^] | 20 | sudo rm -rf ndn-cxx-latest |
| 21 | git clone --depth 1 https://github.com/named-data/ndn-cxx.git ndn-cxx-latest |
Junxiao Shi | 33a24e8 | 2017-05-27 17:09:31 +0000 | [diff] [blame] | 22 | LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 23 | |
| 24 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame^] | 25 | sudo rm -rf ndn-cxx |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 26 | mv ndn-cxx-latest ndn-cxx |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 27 | else |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame^] | 28 | sudo rm -rf ndn-cxx-latest |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 29 | fi |
| 30 | |
Davide Pesavento | 9ac95d3 | 2017-07-01 01:51:37 -0400 | [diff] [blame] | 31 | sudo rm -f /usr/local/bin/ndnsec* |
| 32 | sudo rm -fr /usr/local/include/ndn-cxx |
Md Ashiqur Rahman | 922330b | 2018-09-04 17:55:18 +0000 | [diff] [blame] | 33 | sudo rm -f /usr/local/lib{,64}/libndn-cxx* |
| 34 | sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 35 | |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 36 | pushd ndn-cxx >/dev/null |
Alexander Afanasyev | 4d4e725 | 2014-10-25 12:21:53 -0700 | [diff] [blame] | 37 | |
Davide Pesavento | 56c68a3 | 2020-03-12 19:26:21 -0400 | [diff] [blame] | 38 | ./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain |
| 39 | ./waf --color=yes build -j$WAF_JOBS |
| 40 | sudo_preserve_env PATH -- ./waf --color=yes install |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 41 | |
| 42 | popd >/dev/null |
| 43 | popd >/dev/null |
| 44 | |
| 45 | if has Linux $NODE_LABELS; then |
| 46 | sudo ldconfig |
Joao Pereira | 08f0701 | 2015-07-06 18:13:29 -0400 | [diff] [blame] | 47 | fi |