build+ci: support macOS on arm64
Refs: #5135 Change-Id: I86f1955366df12cfb8b3e6f9d5e9f202778cc211
This commit is contained in:
@@ -16,6 +16,11 @@ case $(uname) in
|
||||
# Emulate a subset of os-release(5)
|
||||
export ID=macos
|
||||
export VERSION_ID=$(sw_vers -productVersion)
|
||||
if [[ -x /opt/homebrew/bin/brew ]]; then
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
elif [[ -x /usr/local/bin/brew ]]; then
|
||||
eval "$(/usr/local/bin/brew shellenv)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
+2
-2
@@ -54,8 +54,8 @@ from waflib import Utils, Logs, Errors
|
||||
from waflib.Configure import conf
|
||||
from waflib.TaskGen import feature, after_method
|
||||
|
||||
BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib']
|
||||
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include']
|
||||
BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/homebrew/lib', '/opt/local/lib', '/sw/lib', '/lib']
|
||||
BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/homebrew/include', '/opt/local/include', '/sw/include']
|
||||
|
||||
BOOST_VERSION_FILE = 'boost/version.hpp'
|
||||
BOOST_VERSION_CODE = '''
|
||||
|
||||
@@ -33,7 +33,7 @@ def configure(conf):
|
||||
'The minimum supported clang version is 6.0.')
|
||||
conf.flags = ClangFlags()
|
||||
else:
|
||||
warnmsg = '%s compiler is unsupported' % cxx
|
||||
warnmsg = f'{cxx} compiler is unsupported'
|
||||
conf.flags = CompilerFlags()
|
||||
|
||||
if errmsg:
|
||||
@@ -200,7 +200,8 @@ class ClangFlags(GccBasicFlags):
|
||||
flags = super(ClangFlags, self).getGeneralFlags(conf)
|
||||
if Utils.unversioned_sys_platform() == 'darwin':
|
||||
# Bug #4296
|
||||
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew
|
||||
brewdir = '/opt/homebrew' if platform.machine() == 'arm64' else '/usr/local'
|
||||
flags['CXXFLAGS'] += [['-isystem', f'{brewdir}/include'], # for Homebrew
|
||||
['-isystem', '/opt/local/include']] # for MacPorts
|
||||
elif Utils.unversioned_sys_platform() == 'freebsd':
|
||||
# Bug #4790
|
||||
|
||||
+2
-2
@@ -9,10 +9,10 @@ NFD relies on third-party software, licensed under the following licenses:
|
||||
- The Boost libraries are licensed under the
|
||||
[Boost Software License 1.0](https://www.boost.org/users/license.html)
|
||||
|
||||
- CityHash is licensed under a
|
||||
- CityHash is licensed under the
|
||||
[MIT license](https://github.com/google/cityhash/blob/master/COPYING)
|
||||
|
||||
- Libpcap is licensed under a
|
||||
- Libpcap is licensed under the
|
||||
[3-clause BSD license](https://github.com/the-tcpdump-group/libpcap/blob/master/LICENSE)
|
||||
|
||||
- The WebSocket++ library is licensed under the terms of the
|
||||
|
||||
+15
-15
@@ -7,23 +7,23 @@ Supported platforms
|
||||
NFD is built against a continuous integration system and has been tested on the
|
||||
following platforms:
|
||||
|
||||
- Ubuntu 18.04 (amd64, armhf, i386)
|
||||
- Ubuntu 20.04 (amd64)
|
||||
- Ubuntu 21.10 (amd64)
|
||||
- CentOS Stream 9
|
||||
- macOS 10.15
|
||||
- macOS 11 (Intel only)
|
||||
- Ubuntu 18.04
|
||||
- Ubuntu 20.04
|
||||
- Ubuntu 22.04
|
||||
- Debian 11
|
||||
- CentOS Stream 9
|
||||
- macOS 10.15
|
||||
- macOS 11
|
||||
- macOS 12
|
||||
|
||||
NFD is known to work on the following platforms, although they are not officially
|
||||
supported:
|
||||
|
||||
- Alpine >= 3.12
|
||||
- Debian >= 10
|
||||
- Fedora >= 29
|
||||
- Gentoo Linux
|
||||
- Raspberry Pi OS (formerly Raspbian) >= 2019-06-20
|
||||
- FreeBSD >= 12.0
|
||||
- macOS 10.14
|
||||
- Alpine >= 3.12
|
||||
- Fedora >= 29
|
||||
- Gentoo Linux
|
||||
- Raspberry Pi OS (formerly Raspbian) >= 2019-06-20
|
||||
- FreeBSD >= 12.0
|
||||
|
||||
.. _Install NFD on Ubuntu Linux using the NDN PPA repository:
|
||||
|
||||
@@ -76,7 +76,7 @@ Downloading from git
|
||||
|
||||
The first step is to obtain the source code for NFD and its main dependency, the
|
||||
*ndn-cxx* library. If you do not want a development version of NFD, make sure you
|
||||
checkout the correct release tag (e.g., ``*-0.7.1``) from both repositories.
|
||||
checkout the correct release tag (e.g., ``*-0.8.0``) from both repositories.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
@@ -100,7 +100,7 @@ and its prerequisites.
|
||||
|
||||
On Linux, NFD needs the following dependencies to enable optional features:
|
||||
|
||||
- On **Ubuntu**:
|
||||
- On **Debian** and **Ubuntu**:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
||||
+10
-14
@@ -1,13 +1,12 @@
|
||||
Starting NFD on OSX >= 10.8
|
||||
===========================
|
||||
# Starting NFD on macOS
|
||||
|
||||
OSX provides a standard way to start system daemons, monitor their health, and restart
|
||||
when they die.
|
||||
macOS provides a standard way to start system daemons, monitor their health, and restart
|
||||
them when they die.
|
||||
|
||||
Initial setup
|
||||
-------------
|
||||
## Initial setup
|
||||
|
||||
Edit `net.named-data.nfd` correcting paths for `nfd` binary, configuration and log files.
|
||||
Edit `net.named-data.nfd.plist` as needed, adjusting the paths for the `nfd` binary,
|
||||
configuration, and log files.
|
||||
|
||||
# Copy launchd.plist for NFD
|
||||
sudo cp net.named-data.nfd.plist /Library/LaunchDaemons/
|
||||
@@ -58,8 +57,8 @@ Folder `/usr/local/var/log/ndn` should be created and assigned proper user and g
|
||||
|
||||
`HOME` directory for `nfd` should be created and configured with correct library's config file
|
||||
and contain proper NDN security credentials for signing Data packets. This is necessary since
|
||||
default private key storage on OSX (`osx-keychain`) does not support non-interactive access,
|
||||
and file-based private key storage needs to be used:
|
||||
the default private key storage on macOS (`tpm-osxkeychain`) does not support non-interactive
|
||||
access, and file-based private key storage needs to be used:
|
||||
|
||||
# Create HOME and generate self-signed NDN certificate for nfd
|
||||
sudo -s -- ' \
|
||||
@@ -115,13 +114,10 @@ be exported into `localhost_daemons_nfd.ndncert` file:
|
||||
/usr/local/etc/ndn/certs/localhost_daemons_nfd.ndncert; \
|
||||
'
|
||||
|
||||
|
||||
Enable auto-start
|
||||
-----------------
|
||||
## Enable auto-start
|
||||
|
||||
sudo launchctl load -w /Library/LaunchDaemons/net.named-data.nfd.plist
|
||||
|
||||
Disable auto-start
|
||||
------------------
|
||||
## Disable auto-start
|
||||
|
||||
sudo launchctl unload -w /Library/LaunchDaemons/net.named-data.nfd.plist
|
||||
|
||||
@@ -423,17 +423,25 @@ BOOST_FIXTURE_TEST_CASE(ChangeMcastEndpointV6, UdpFactoryMcastFixture)
|
||||
parseConfig(CONFIG1, false);
|
||||
auto udpMcastFaces = this->listUdp6McastFaces();
|
||||
BOOST_REQUIRE_EQUAL(udpMcastFaces.size(), netifsV6.size());
|
||||
auto expectedAddr = boost::asio::ip::address_v6::from_string("ff02::1101");
|
||||
expectedAddr.scope_id(netifsV6.front()->getIndex());
|
||||
BOOST_CHECK_EQUAL(udpMcastFaces.front()->getRemoteUri(), FaceUri(udp::Endpoint(expectedAddr, 7011)));
|
||||
auto uri = udpMcastFaces.front()->getRemoteUri();
|
||||
BOOST_CHECK_EQUAL(uri.getScheme(), "udp6");
|
||||
// check the address ignoring the scope id
|
||||
auto addr = boost::asio::ip::address_v6::from_string(uri.getHost());
|
||||
addr.scope_id(0);
|
||||
BOOST_CHECK_EQUAL(addr, boost::asio::ip::address_v6::from_string("ff02::1101"));
|
||||
BOOST_CHECK_EQUAL(uri.getPort(), "7011");
|
||||
|
||||
parseConfig(CONFIG2, false);
|
||||
g_io.poll();
|
||||
udpMcastFaces = this->listUdp6McastFaces();
|
||||
BOOST_REQUIRE_EQUAL(udpMcastFaces.size(), netifsV6.size());
|
||||
expectedAddr = boost::asio::ip::address_v6::from_string("ff02::1102");
|
||||
expectedAddr.scope_id(netifsV6.front()->getIndex());
|
||||
BOOST_CHECK_EQUAL(udpMcastFaces.front()->getRemoteUri(), FaceUri(udp::Endpoint(expectedAddr, 7012)));
|
||||
uri = udpMcastFaces.front()->getRemoteUri();
|
||||
BOOST_CHECK_EQUAL(uri.getScheme(), "udp6");
|
||||
// check the address ignoring the scope id
|
||||
addr = boost::asio::ip::address_v6::from_string(uri.getHost());
|
||||
addr.scope_id(0);
|
||||
BOOST_CHECK_EQUAL(addr, boost::asio::ip::address_v6::from_string("ff02::1102"));
|
||||
BOOST_CHECK_EQUAL(uri.getPort(), "7012");
|
||||
}
|
||||
|
||||
BOOST_FIXTURE_TEST_CASE(Whitelist, UdpFactoryMcastFixture)
|
||||
|
||||
Reference in New Issue
Block a user