From 2e81c0487bdfae08f45f5441da38b6d3992c5738 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 17 Nov 2021 13:26:40 -0800 Subject: [PATCH] Bumps in garden : ign-rendering (#1685) Signed-off-by: Steve Peters --- Aliases/ignition-rendering7 | 1 - Formula/ignition-rendering7.rb | 66 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) delete mode 120000 Aliases/ignition-rendering7 create mode 100644 Formula/ignition-rendering7.rb diff --git a/Aliases/ignition-rendering7 b/Aliases/ignition-rendering7 deleted file mode 120000 index 2d7eb56fe..000000000 --- a/Aliases/ignition-rendering7 +++ /dev/null @@ -1 +0,0 @@ -../Formula/ignition-rendering6.rb \ No newline at end of file diff --git a/Formula/ignition-rendering7.rb b/Formula/ignition-rendering7.rb new file mode 100644 index 000000000..a0cbc6526 --- /dev/null +++ b/Formula/ignition-rendering7.rb @@ -0,0 +1,66 @@ +class IgnitionRendering7 < Formula + desc "Rendering library for robotics applications" + homepage "https://github.com/ignitionrobotics/ign-rendering" + url "https://github.com/ignitionrobotics/ign-rendering.git", branch: "main" + version "6.999.999~0~20211116" + license "Apache-2.0" + + depends_on "cmake" => [:build, :test] + depends_on "pkg-config" => [:build, :test] + + depends_on "freeimage" + depends_on "ignition-cmake2" + depends_on "ignition-common4" + depends_on "ignition-math6" + depends_on "ignition-plugin1" + depends_on macos: :mojave # c++17 + depends_on "ogre1.9" + depends_on "ogre2.2" + + def install + cmake_args = std_cmake_args + cmake_args << "-DBUILD_TESTING=Off" + cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}" + system "cmake", ".", *cmake_args + system "make", "install" + end + + test do + github_actions = ENV["HOMEBREW_GITHUB_ACTIONS"].present? + (testpath/"test.cpp").write <<-EOS + #include + #include + int main(int _argc, char** _argv) + { + ignition::rendering::RenderEngine *engine = + ignition::rendering::engine("ogre"); + return engine == nullptr; + } + EOS + (testpath/"CMakeLists.txt").write <<-EOS + cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) + find_package(ignition-rendering7 QUIET REQUIRED) + add_executable(test_cmake test.cpp) + target_link_libraries(test_cmake ignition-rendering7::ignition-rendering7) + EOS + # test building with pkg-config + system "pkg-config", "ignition-rendering7" + cflags = `pkg-config --cflags ignition-rendering7`.split + ldflags = `pkg-config --libs ignition-rendering7`.split + system ENV.cc, "test.cpp", + *cflags, + *ldflags, + "-lc++", + "-o", "test" + system "./test" unless github_actions + # test building with cmake + mkdir "build" do + system "cmake", ".." + system "make" + system "./test_cmake" unless github_actions + end + # check for Xcode frameworks in bottle + cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}" + system cmd_not_grep_xcode + end +end