Skip to content

Commit

Permalink
Bumps in ionic : ci_matching_branch/bump_ionic_gz-transport14 (#2474)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Addisu Z. Taddese <[email protected]>
Co-authored-by: Addisu Z. Taddese <[email protected]>
  • Loading branch information
iche033 and azeey authored Oct 17, 2023
1 parent 71fe2dd commit b2e7e7f
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 1 deletion.
1 change: 0 additions & 1 deletion Aliases/gz-transport14

This file was deleted.

85 changes: 85 additions & 0 deletions Formula/gz-transport14.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
class GzTransport14 < Formula
desc "Transport middleware for robotics"
homepage "https://gazebosim.org"
url "https://github.com/gazebosim/gz-transport.git", branch: "main"
version "13.999.999-0-20231016"
license "Apache-2.0"

head "https://github.com/gazebosim/gz-transport.git", branch: "main"

depends_on "doxygen" => [:build, :optional]
depends_on "pybind11" => :build

depends_on "cmake"
depends_on "cppzmq"
depends_on "gz-cmake4"
depends_on "gz-msgs11"
depends_on "gz-tools2"
depends_on "gz-utils3"
depends_on macos: :mojave # c++17
depends_on "ossp-uuid"
depends_on "pkg-config"
depends_on "protobuf"
depends_on "[email protected]"
depends_on "zeromq"

def install
rpaths = [
rpath,
rpath(source: libexec/"gz/transport14", target: lib),
]
cmake_args = std_cmake_args
cmake_args << "-DBUILD_TESTING=OFF"
cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpaths.join(";")}"

# Use build folder
mkdir "build" do
system "cmake", "..", *cmake_args
system "make", "install"
end

(lib/"python3.11/site-packages").install Dir[lib/"python/*"]
rmdir prefix/"lib/python"
end

test do
# test CLI executables
system libexec/"gz/transport14/gz-transport-service"
system libexec/"gz/transport14/gz-transport-topic"
# build against API
(testpath/"test.cpp").write <<-EOS
#include <iostream>
#include <gz/transport.hh>
int main() {
gz::transport::NodeOptions options;
return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
find_package(gz-transport14 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake gz-transport14::gz-transport14)
EOS
system "pkg-config", "gz-transport14"
cflags = `pkg-config --cflags gz-transport14`.split
system ENV.cc, "test.cpp",
*cflags,
"-L#{lib}",
"-lgz-transport14",
"-lc++",
"-o", "test"
ENV["GZ_PARTITION"] = rand((1 << 32) - 1).to_s
system "./test"
mkdir "build" do
system "cmake", ".."
system "make"
system "./test_cmake"
end
# check for Xcode frameworks in bottle
cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
system cmd_not_grep_xcode
# check python import
system Formula["[email protected]"].opt_bin/"python3.11", "-c", "import gz.transport14"
end
end

0 comments on commit b2e7e7f

Please sign in to comment.