Varun Patil | a24bd3e | 2020-11-24 10:08:33 +0530 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -ex |
| 3 | |
| 4 | pushd "$CACHE_DIR" >/dev/null |
| 5 | |
| 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 |
| 19 | |
| 20 | sudo rm -rf ndn-cxx-latest |
| 21 | git clone --depth 1 https://github.com/named-data/ndn-cxx.git ndn-cxx-latest |
| 22 | LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
| 23 | |
| 24 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 25 | sudo rm -rf ndn-cxx |
| 26 | mv ndn-cxx-latest ndn-cxx |
| 27 | else |
| 28 | sudo rm -rf ndn-cxx-latest |
| 29 | fi |
| 30 | |
| 31 | sudo rm -f /usr/local/bin/ndnsec* |
| 32 | sudo rm -fr /usr/local/include/ndn-cxx |
| 33 | sudo rm -f /usr/local/lib{,64}/libndn-cxx* |
| 34 | sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc |
| 35 | |
| 36 | pushd ndn-cxx >/dev/null |
| 37 | |
| 38 | if has CentOS-8 $NODE_LABELS; then |
| 39 | # https://bugzilla.redhat.com/show_bug.cgi?id=1721553 |
| 40 | PCH="--without-pch" |
| 41 | fi |
| 42 | |
| 43 | ./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain $PCH |
| 44 | ./waf --color=yes build -j$WAF_JOBS |
| 45 | sudo_preserve_env PATH -- ./waf --color=yes install |
| 46 | |
| 47 | popd >/dev/null |
| 48 | popd >/dev/null |
| 49 | |
| 50 | if has CentOS-8 $NODE_LABELS; then |
| 51 | sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64 |
| 52 | fi |
| 53 | if has Linux $NODE_LABELS; then |
| 54 | sudo ldconfig |
| 55 | fi |