diff --git a/Aliases/ignition-rendering5 b/Aliases/ignition-rendering5 deleted file mode 120000 index d220ba81c..000000000 --- a/Aliases/ignition-rendering5 +++ /dev/null @@ -1 +0,0 @@ -../Formula/ignition-rendering4.rb \ No newline at end of file diff --git a/Formula/ignition-rendering5.rb b/Formula/ignition-rendering5.rb new file mode 100644 index 000000000..e8bec5796 --- /dev/null +++ b/Formula/ignition-rendering5.rb @@ -0,0 +1,73 @@ +class IgnitionRendering5 < Formula + desc "Rendering library for robotics applications" + homepage "https://github.com/ignitionrobotics/ign-rendering" + url "https://github.com/ignitionrobotics/ign-rendering/archive/d18dd1c6540b2aaa581a3f48ce96022d7ba19bda.tar.gz" + version "4.999.999~0~20201028~d18dd1" + sha256 "4c97c5eb65b3c939db06176b5d1b3728af69ce17a0bb7ba522fcadcbac6b5c2b" + license "Apache-2.0" + + bottle do + root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation" + sha256 "35082f18452e773aa38c5ad2852e6d2f12f97e9a2399497436970f75fa5b4957" => :mojave + end + + depends_on "cmake" => [:build, :test] + depends_on "pkg-config" => [:build, :test] + + depends_on "freeimage" + depends_on "ignition-cmake2" + depends_on "ignition-common3" + depends_on "ignition-math6" + depends_on "ignition-plugin1" + depends_on macos: :mojave # c++17 + depends_on "ogre1.9" + depends_on "ogre2.1" + + def install + cmake_args = std_cmake_args + cmake_args << "-DBUILD_TESTING=Off" + system "cmake", ".", *cmake_args + system "make", "install" + end + + test do + azure = ENV["HOMEBREW_AZURE_PIPELINES"].present? + github_actions = ENV["HOMEBREW_GITHUB_ACTIONS"].present? + travis = ENV["HOMEBREW_TRAVIS_CI"].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-rendering5 QUIET REQUIRED) + add_executable(test_cmake test.cpp) + target_link_libraries(test_cmake ignition-rendering5::ignition-rendering5) + EOS + # test building with pkg-config + system "pkg-config", "ignition-rendering5" + cflags = `pkg-config --cflags ignition-rendering5`.split(" ") + ldflags = `pkg-config --libs ignition-rendering5`.split(" ") + system ENV.cc, "test.cpp", + *cflags, + *ldflags, + "-lc++", + "-o", "test" + system "./test" unless azure || github_actions || travis + # test building with cmake + mkdir "build" do + system "cmake", ".." + system "make" + system "./test_cmake" unless azure || github_actions || travis + end + # check for Xcode frameworks in bottle + cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}" + system cmd_not_grep_xcode + end +end