Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumps in garden : ign-rendering #1685

Merged
merged 2 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Aliases/ignition-rendering7

This file was deleted.

66 changes: 66 additions & 0 deletions Formula/ignition-rendering7.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
class IgnitionRendering7 < Formula
desc "Rendering library for robotics applications"
homepage "https:/ignitionrobotics/ign-rendering"
url "https:/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 <ignition/rendering/RenderEngine.hh>
#include <ignition/rendering/RenderingIface.hh>
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