Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame^] | 2 | set -ex |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 3 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame^] | 4 | pushd "$CACHE_DIR" >/dev/null |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 5 | |
Ashlesh Gawande | 812af97 | 2017-04-21 09:26:37 -0500 | [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 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 16 | if [[ -z $INSTALLED_VERSION ]]; then |
| 17 | INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE) |
| 18 | fi |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 19 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -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 |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 22 | LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
| 23 | |
| 24 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame^] | 25 | sudo rm -rf ndn-cxx |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 26 | mv ndn-cxx-latest ndn-cxx |
| 27 | else |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame^] | 28 | sudo rm -rf ndn-cxx-latest |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 29 | fi |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 30 | |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 31 | sudo rm -f /usr/local/bin/ndnsec* |
| 32 | sudo rm -fr /usr/local/include/ndn-cxx |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [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 | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 35 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 36 | pushd ndn-cxx >/dev/null |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 37 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame^] | 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 |
Alexander Afanasyev | 24ed83a | 2015-03-30 11:06:50 -0700 | [diff] [blame] | 46 | |
| 47 | popd >/dev/null |
| 48 | popd >/dev/null |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 49 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame^] | 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 |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 53 | if has Linux $NODE_LABELS; then |
| 54 | sudo ldconfig |
Alexander Afanasyev | f9f3910 | 2015-12-01 17:43:40 -0800 | [diff] [blame] | 55 | fi |