blob: 7413abe60ccde245b4742dac1704f45a7d128f0e [file] [log] [blame]
Alexander Afanasyevb2cf5c02016-03-21 11:04:28 -07001#!/usr/bin/env bash
2
Alexander Afanasyev712dedc2017-02-09 16:31:41 -08003# Avoid dependency on non-standard tools
4export PATH=/usr/bin:/bin:/usr/sbin:/sbin
5export PKGCONFIG=/usr/local/bin/pkg-config
6
Qi Zhao6d0399e2017-02-23 16:24:39 -08007NDN_CXX_COMMIT=${NDN_CXX_COMMIT:-1709aa70999bd8cbe0e7c680aaab37f2d24323a5}
8NFD_COMMIT=${NFD_COMMIT:-d396b61ba14a84b34d3ae65db4530062f7d43301}
Alexander Afanasyevca6d5d92017-02-02 20:43:59 -08009NDN_TOOLS_COMMIT=${NDN_TOOLS_COMMIT:-ndn-tools-0.4}
Alexander Afanasyevb2cf5c02016-03-21 11:04:28 -070010
11GIT=${GIT:-https://github.com/named-data}
12
13mkdir build 2>/dev/null || true
14path="$(pwd)"
15
16#######################################
17
Alexander Afanasyev11ae34d2016-03-21 11:55:16 -070018rm -Rf build/ndn-cxx
Alexander Afanasyevb2cf5c02016-03-21 11:04:28 -070019git clone ${GIT}/ndn-cxx build/ndn-cxx
20pushd build/ndn-cxx
21git checkout ${NDN_CXX_COMMIT}
Alexander Afanasyev8e986f82016-03-21 14:19:15 -070022
23patch -p1 <<EOF
24diff --git a/src/transport/unix-transport.cpp b/src/transport/unix-transport.cpp
Qi Zhao0e043e52016-12-05 18:27:09 -080025index f2e44aa..268f967 100644
Alexander Afanasyev8e986f82016-03-21 14:19:15 -070026--- a/src/transport/unix-transport.cpp
27+++ b/src/transport/unix-transport.cpp
Qi Zhao0e043e52016-12-05 18:27:09 -080028@@ -40,7 +40,7 @@ std::string
29 UnixTransport::getSocketNameFromUri(const std::string& uriString)
30 {
Alexander Afanasyev8e986f82016-03-21 14:19:15 -070031 // Assume the default nfd.sock location.
Qi Zhao0e043e52016-12-05 18:27:09 -080032- std::string path = "/var/run/nfd.sock";
33+ std::string path = "/tmp/nfd.sock";
Alexander Afanasyev964feb92016-03-22 13:03:11 -070034
Qi Zhao0e043e52016-12-05 18:27:09 -080035 if (uriString.empty()) {
36 return path;
Alexander Afanasyev8e986f82016-03-21 14:19:15 -070037EOF
38
Alexander Afanasyev964feb92016-03-22 13:03:11 -070039./waf configure --prefix="${path}/build/deps" \
40 --sysconfdir="/Applications/NDN.app/Contents/etc"
Alexander Afanasyevb2cf5c02016-03-21 11:04:28 -070041./waf build
42./waf install
43popd
44
45####################################
46
Alexander Afanasyev11ae34d2016-03-21 11:55:16 -070047rm -Rf build/NFD
Alexander Afanasyevb2cf5c02016-03-21 11:04:28 -070048git clone ${GIT}/NFD build/NFD
49pushd build/NFD
50git checkout ${NFD_COMMIT}
51git submodule update --init
52PKG_CONFIG_PATH="${path}/build/deps/lib/pkgconfig:${PKG_CONFIG_PATH}" \
Alexander Afanasyev964feb92016-03-22 13:03:11 -070053 ./waf configure --prefix="${path}/build/deps" \
54 --sysconfdir="/Applications/NDN.app/Contents/etc"
Alexander Afanasyevb2cf5c02016-03-21 11:04:28 -070055./waf build
56./waf install
57popd
Alexander Afanasyev8e986f82016-03-21 14:19:15 -070058
Qi Zhao5fc9a702016-12-23 17:32:01 -080059####################################
60
61rm -Rf build/ndn-tools
62git clone ${GIT}/ndn-tools build/ndn-tools
63pushd build/ndn-tools
64git checkout ${NDN_TOOLS_COMMIT}
65PKG_CONFIG_PATH="${path}/build/deps/lib/pkgconfig:${PKG_CONFIG_PATH}" \
66 ./waf configure --prefix="${path}/build/deps" \
67 --sysconfdir="/Applications/NDN.app/Contents/etc"
68./waf build
69./waf install
70popd
71
72####################################
73
Alexander Afanasyev8e986f82016-03-21 14:19:15 -070074PKG_CONFIG_PATH="${path}/build/deps/lib/pkgconfig:${PKG_CONFIG_PATH}" \
75 ./waf configure