From d0c4761527e90ba76ae8f6e324826d145b3ea099 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Tue, 13 Apr 2021 18:57:10 -0700 Subject: [PATCH] Bumps in fortress : ign-msgs (#1423) * Bumps in fortress : ign-msgs Signed-off-by: Louise Poubel * update bottle. Co-authored-by: OSRF Build Bot --- Aliases/ignition-msgs8 | 1 - Formula/ignition-msgs8.rb | 72 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) delete mode 120000 Aliases/ignition-msgs8 create mode 100644 Formula/ignition-msgs8.rb diff --git a/Aliases/ignition-msgs8 b/Aliases/ignition-msgs8 deleted file mode 120000 index 8a816db85..000000000 --- a/Aliases/ignition-msgs8 +++ /dev/null @@ -1 +0,0 @@ -../Formula/ignition-msgs7.rb \ No newline at end of file diff --git a/Formula/ignition-msgs8.rb b/Formula/ignition-msgs8.rb new file mode 100644 index 000000000..00fad80b8 --- /dev/null +++ b/Formula/ignition-msgs8.rb @@ -0,0 +1,72 @@ +class IgnitionMsgs8 < Formula + desc "Middleware protobuf messages for robotics" + homepage "https://github.com/ignitionrobotics/ign-msgs" + url "https://github.com/ignitionrobotics/ign-msgs/archive/9fb08e926cd3a7b75cdd5706ccc9ae3ca4dfc457.tar.gz" + version "7.999.999~0~20210413~9fb08e" + sha256 "1493d7024f0615bc147bf6b79c3e959b2ac4cd81362ae63ea9266f3166a47177" + license "Apache-2.0" + + head "https://github.com/ignitionrobotics/ign-msgs.git", branch: "main" + + bottle do + root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation" + sha256 cellar: :any, catalina: "3885af366e231f256c0c683c66cc0e52421ddee9edb8e089f1341207d9ea7121" + sha256 cellar: :any, mojave: "0420836e67b7dd4172cd9a126bb81892c53b076f9e5406cea55ab5d9bb2ad0c3" + end + + depends_on "protobuf-c" => :build + depends_on "cmake" + depends_on "ignition-cmake2" + depends_on "ignition-math6" + depends_on "ignition-tools" + depends_on macos: :high_sierra # c++17 + depends_on "pkg-config" + depends_on "protobuf" + depends_on "tinyxml2" + + def install + cmake_args = std_cmake_args + cmake_args << "-DBUILD_TESTING=Off" + + system "cmake", ".", *cmake_args + system "make", "install" + end + + test do + (testpath/"test.cpp").write <<-EOS + #include + int main() { + ignition::msgs::UInt32; + return 0; + } + EOS + (testpath/"CMakeLists.txt").write <<-EOS + cmake_minimum_required(VERSION 3.10 FATAL_ERROR) + find_package(ignition-msgs8 QUIET REQUIRED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGNITION-MSGS_CXX_FLAGS}") + include_directories(${IGNITION-MSGS_INCLUDE_DIRS}) + link_directories(${IGNITION-MSGS_LIBRARY_DIRS}) + add_executable(test_cmake test.cpp) + target_link_libraries(test_cmake ignition-msgs8::ignition-msgs8) + EOS + # test building with pkg-config + system "pkg-config", "ignition-msgs8" + cflags = `pkg-config --cflags ignition-msgs8`.split + system ENV.cc, "test.cpp", + *cflags, + "-L#{lib}", + "-lignition-msgs8", + "-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