From f9807f3c4a5e57e5173c04449d6f3dbd842c96f0 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Fri, 6 Oct 2023 17:09:22 -0500 Subject: [PATCH 1/2] Bumps in ionic : ci_matching_branch/bump_ionic_gz-utils3 Signed-off-by: Addisu Z. Taddese --- Aliases/gz-utils3 | 1 - Formula/gz-utils3.rb | 0 2 files changed, 1 deletion(-) delete mode 120000 Aliases/gz-utils3 create mode 100644 Formula/gz-utils3.rb diff --git a/Aliases/gz-utils3 b/Aliases/gz-utils3 deleted file mode 120000 index 662cee2fb..000000000 --- a/Aliases/gz-utils3 +++ /dev/null @@ -1 +0,0 @@ -../Formula/gz-utils2.rb \ No newline at end of file diff --git a/Formula/gz-utils3.rb b/Formula/gz-utils3.rb new file mode 100644 index 000000000..e69de29bb From 381d8ed5727c16320916820576a83418c4d282b3 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 11 Oct 2023 06:04:17 -0700 Subject: [PATCH 2/2] gz-utils3: new formula for ionic Signed-off-by: Steve Peters --- Formula/gz-utils3.rb | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/Formula/gz-utils3.rb b/Formula/gz-utils3.rb index e69de29bb..9cf819a8d 100644 --- a/Formula/gz-utils3.rb +++ b/Formula/gz-utils3.rb @@ -0,0 +1,64 @@ +class GzUtils3 < Formula + desc "General purpose classes and functions designed for robotic applications" + homepage "https://github.com/gazebosim/gz-utils" + url "https://github.com/gazebosim/gz-utils.git", branch: "main" + version "2.999.999-0-20231011" + license "Apache-2.0" + + depends_on "cmake" => [:build, :test] + depends_on "pkg-config" => [:build, :test] + depends_on "gz-cmake4" + + def install + cmake_args = std_cmake_args + cmake_args << "-DBUILD_TESTING=OFF" + cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}" + + # Use build folder + mkdir "build" do + system "cmake", "..", *cmake_args + system "make", "install" + end + end + + test do + (testpath/"test.cpp").write <<-EOS + #include + class SomeClassPrivate + { + }; + class SomeClass + { + private: gz::utils::ImplPtr dataPtr = + gz::utils::MakeImpl(); + }; + int main() { + SomeClass object; + return 0; + } + EOS + (testpath/"CMakeLists.txt").write <<-EOS + cmake_minimum_required(VERSION 3.5 FATAL_ERROR) + find_package(gz-utils3 QUIET REQUIRED) + add_executable(test_cmake test.cpp) + target_link_libraries(test_cmake gz-utils3::gz-utils3) + EOS + system "pkg-config", "gz-utils3" + cflags = `pkg-config --cflags gz-utils3`.split + ldflags = `pkg-config --libs gz-utils3`.split + system ENV.cxx, "test.cpp", + *cflags, + *ldflags, + "-o", "test" + system "./test" + # test building with cmake + 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 + end +end