From 7cffedcc29e12e6c1fc89502d257a012904fc4e9 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Fri, 6 Oct 2023 17:06:36 -0500 Subject: [PATCH 1/2] Bumps in ionic : ci_matching_branch/bump_ionic_gz-math8 Signed-off-by: Addisu Z. Taddese --- Aliases/gz-math8 | 1 - Formula/gz-math8.rb | 71 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) delete mode 120000 Aliases/gz-math8 create mode 100644 Formula/gz-math8.rb diff --git a/Aliases/gz-math8 b/Aliases/gz-math8 deleted file mode 120000 index da5511f8a..000000000 --- a/Aliases/gz-math8 +++ /dev/null @@ -1 +0,0 @@ -../Formula/gz-math7.rb \ No newline at end of file diff --git a/Formula/gz-math8.rb b/Formula/gz-math8.rb new file mode 100644 index 000000000..3a6c88e79 --- /dev/null +++ b/Formula/gz-math8.rb @@ -0,0 +1,71 @@ +class GzMath8 < Formula + desc "Math API for robotic applications" + homepage "https://gazebosim.org" + url "https://github.com/gazebosim/gz-math.git", branch: "main" + version "7.999.999~0~20231006" + license "Apache-2.0" + + head "https://github.com/gazebosim/gz-math.git", branch: "gz-math8" + + depends_on "cmake" => :build + depends_on "doxygen" => :build + depends_on "pybind11" => :build + depends_on "eigen" + depends_on "gz-cmake4" + depends_on "gz-utils3" + depends_on "python@3.11" + depends_on "ruby" + + 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 + + (lib/"python3.11/site-packages").install Dir[lib/"python/*"] + rmdir prefix/"lib/python" + end + + test do + (testpath/"test.cpp").write <<-EOS + #include "gz/math/SignalStats.hh" + int main() { + gz::math::SignalMean mean; + mean.InsertData(1.0); + mean.InsertData(-1.0); + return static_cast(mean.Value()); + } + EOS + (testpath/"CMakeLists.txt").write <<-EOS + cmake_minimum_required(VERSION 3.5 FATAL_ERROR) + find_package(gz-math8 QUIET REQUIRED) + add_executable(test_cmake test.cpp) + target_link_libraries(test_cmake gz-math8::gz-math8) + EOS + # test building with manual compiler flags + system ENV.cc, "test.cpp", + "--std=c++14", + "-I#{include}/gz/math8", + "-L#{lib}", + "-lgz-math8", + "-lc++", + "-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 + # check python import + system Formula["python@3.11"].opt_bin/"python3.11", "-c", "import gz.math8" + end +end From 67e41467194092f5c50502ddd4b62958fa582feb Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Tue, 10 Oct 2023 13:30:04 -0700 Subject: [PATCH 2/2] gz-math8: use - in version string --- Formula/gz-math8.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/gz-math8.rb b/Formula/gz-math8.rb index 3a6c88e79..e132d0883 100644 --- a/Formula/gz-math8.rb +++ b/Formula/gz-math8.rb @@ -2,7 +2,7 @@ class GzMath8 < Formula desc "Math API for robotic applications" homepage "https://gazebosim.org" url "https://github.com/gazebosim/gz-math.git", branch: "main" - version "7.999.999~0~20231006" + version "7.999.999-0-20231006" license "Apache-2.0" head "https://github.com/gazebosim/gz-math.git", branch: "gz-math8"