From d3d68dc02332faa72ce4df609b52c547b0d761de Mon Sep 17 00:00:00 2001 From: Franco Cipollone <53065142+francocipollone@users.noreply.github.com> Date: Fri, 17 Nov 2023 11:47:11 -0300 Subject: [PATCH] Bring zenoh router via vendor. (#63) * Bring zenoh router via vendor. Signed-off-by: Franco Cipollone --- README.md | 7 ------- rmw_zenoh_cpp/package.xml | 1 + zenohd_vendor/CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ zenohd_vendor/package.xml | 17 +++++++++++++++++ 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 zenohd_vendor/CMakeLists.txt create mode 100644 zenohd_vendor/package.xml diff --git a/README.md b/README.md index aa7096ea..7203c35c 100644 --- a/README.md +++ b/README.md @@ -21,13 +21,6 @@ Install latest rustc. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -Install zenohd router -> Note: The manual zenoh router installation won't be required in the future. -```bash -echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | sudo tee -a /etc/apt/sources.list > /dev/null -sudo apt update && sudo apt install zenoh -y -``` - Build `rmw_zenoh_cpp` ```bash diff --git a/rmw_zenoh_cpp/package.xml b/rmw_zenoh_cpp/package.xml index e95c138b..259bbce6 100644 --- a/rmw_zenoh_cpp/package.xml +++ b/rmw_zenoh_cpp/package.xml @@ -10,6 +10,7 @@ ament_cmake zenoh_c_vendor + zenohd_vendor ament_index_cpp fastcdr diff --git a/zenohd_vendor/CMakeLists.txt b/zenohd_vendor/CMakeLists.txt new file mode 100644 index 00000000..a26eed90 --- /dev/null +++ b/zenohd_vendor/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.16) +project(zenohd_vendor) + +# Default to C++17 +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +endif() + +find_package(ament_cmake REQUIRED) + +include(ExternalProject) + +ExternalProject_Add( + zenoh + PREFIX ${CMAKE_BINARY_DIR}/_cargo_deps + GIT_REPOSITORY https://github.com/eclipse-zenoh/zenoh.git + GIT_TAG master + BUILD_COMMAND cargo build --package zenohd --release + CONFIGURE_COMMAND "" # Disable the configure step + INSTALL_COMMAND "" + BUILD_IN_SOURCE 1 +) + +# Install the zenohd executable from the rust crate +install( + PROGRAMS ${CMAKE_BINARY_DIR}/_cargo_deps/src/zenoh/target/release/zenohd + DESTINATION bin +) + +# TODO(francocipollone): Install zenoh router plugins + +ament_package() diff --git a/zenohd_vendor/package.xml b/zenohd_vendor/package.xml new file mode 100644 index 00000000..8a4b1966 --- /dev/null +++ b/zenohd_vendor/package.xml @@ -0,0 +1,17 @@ + + + + zenohd_vendor + 0.0.1 + Vendor pkg to install zenoh router + FrancoCipollone + Apache License 2.0 + + ament_cmake + + + + + ament_cmake + +