blob: 5da6d35d704fad0daae246e7a9c07bdef282b611 [file] [log] [blame]
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04001#!/usr/bin/env bash
Davide Pesaventoec61b742020-04-18 01:00:12 -04002set -ex
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04003
Davide Pesaventoec61b742020-04-18 01:00:12 -04004pushd "$CACHE_DIR" >/dev/null
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04005
6INSTALLED_VERSION=
7if 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
14fi
15
16if [[ -z $INSTALLED_VERSION ]]; then
17 INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
18fi
19
Davide Pesaventoec61b742020-04-18 01:00:12 -040020sudo rm -rf ndn-cxx-latest
21git clone --depth 1 https://github.com/named-data/ndn-cxx.git ndn-cxx-latest
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040022LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
23
24if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
Davide Pesaventoec61b742020-04-18 01:00:12 -040025 sudo rm -rf ndn-cxx
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040026 mv ndn-cxx-latest ndn-cxx
27else
Davide Pesaventoec61b742020-04-18 01:00:12 -040028 sudo rm -rf ndn-cxx-latest
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040029fi
30
31sudo rm -f /usr/local/bin/ndnsec*
32sudo rm -fr /usr/local/include/ndn-cxx
Davide Pesaventoec61b742020-04-18 01:00:12 -040033sudo rm -f /usr/local/lib{,64}/libndn-cxx*
34sudo rm -f /usr/local/lib{,64}/pkgconfig/libndn-cxx.pc
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040035
36pushd ndn-cxx >/dev/null
37
Davide Pesavento7e7bd892022-07-10 00:30:06 -040038./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain
Davide Pesaventoec61b742020-04-18 01:00:12 -040039./waf --color=yes build -j$WAF_JOBS
40sudo_preserve_env PATH -- ./waf --color=yes install
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040041
42popd >/dev/null
43popd >/dev/null
44
Davide Pesavento7e7bd892022-07-10 00:30:06 -040045if has CentOS $NODE_LABELS; then
Davide Pesaventoec61b742020-04-18 01:00:12 -040046 sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
47fi
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040048if has Linux $NODE_LABELS; then
49 sudo ldconfig
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040050fi