From 565b583bc2395963b08ef7a5667e21e5600b41c6 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Wed, 17 Nov 2021 13:32:09 -0800 Subject: [PATCH] Bumps in garden : ign-sensors (#1688) Signed-off-by: Steve Peters --- Aliases/ignition-sensors7 | 1 - Formula/ignition-sensors7.rb | 65 ++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) delete mode 120000 Aliases/ignition-sensors7 create mode 100644 Formula/ignition-sensors7.rb diff --git a/Aliases/ignition-sensors7 b/Aliases/ignition-sensors7 deleted file mode 120000 index 03ea4ef31..000000000 --- a/Aliases/ignition-sensors7 +++ /dev/null @@ -1 +0,0 @@ -../Formula/ignition-sensors6.rb \ No newline at end of file diff --git a/Formula/ignition-sensors7.rb b/Formula/ignition-sensors7.rb new file mode 100644 index 000000000..89db41ed9 --- /dev/null +++ b/Formula/ignition-sensors7.rb @@ -0,0 +1,65 @@ +class IgnitionSensors7 < Formula + desc "Sensors library for robotics applications" + homepage "https://github.com/ignitionrobotics/ign-sensors" + url "https://github.com/ignitionrobotics/ign-sensors.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 "ignition-cmake2" + depends_on "ignition-common4" + depends_on "ignition-math6" + depends_on "ignition-msgs8" + depends_on "ignition-rendering7" + depends_on "ignition-transport11" + depends_on "sdformat12" + + 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 + (testpath/"test.cpp").write <<-EOS + #include + + int main() + { + ignition::sensors::Noise noise(ignition::sensors::NoiseType::NONE); + + return 0; + } + EOS + (testpath/"CMakeLists.txt").write <<-EOS + cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) + find_package(ignition-sensors7 QUIET REQUIRED) + add_executable(test_cmake test.cpp) + target_link_libraries(test_cmake ignition-sensors7::ignition-sensors7) + EOS + # test building with pkg-config + system "pkg-config", "ignition-sensors7" + cflags = `pkg-config --cflags ignition-sensors7`.split + ldflags = `pkg-config --libs ignition-sensors7`.split + system ENV.cc, "test.cpp", + *cflags, + *ldflags, + "-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 + end +end