<commit_before>class IgnitionMsgs1 < Formula
  desc "Middleware protobuf messages for robotics"
  homepage "https://github.com/gazebosim/gz-msgs"
  url "https://osrf-distributions.s3.amazonaws.com/ign-msgs/releases/ignition-msgs-1.0.0.tar.bz2"
  sha256 "fed54d079a58087fa83cc871f01ba2919866292ba949b6b8f37a0cb3d7186b4b"
  license "Apache-2.0"
  revision 16
  version_scheme 1

  head "https://github.com/gazebosim/gz-msgs.git", branch: "ign-msgs1"

  depends_on "protobuf-c" => :build
  depends_on "cmake"
  depends_on "ignition-cmake0"
  depends_on "ignition-math4"
  depends_on "pkg-config"
  depends_on "protobuf"
  depends_on "ignition-tools" => :recommended

  def install
    cmake_args = std_cmake_args
    cmake_args << "-DBUILD_TESTING=Off"
    cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}"

    mkdir "build" do
      system "cmake", "..", *cmake_args
      system "make", "install"
    end
  end

  test do
    (testpath/"test.cpp").write <<-EOS
      #include <ignition/msgs.hh>
      int main() {
        ignition::msgs::UInt32;
        return 0;
      }
    EOS
    (testpath/"CMakeLists.txt").write <<-EOS
      cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
      find_package(ignition-msgs1 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-msgs1::ignition-msgs1)
    EOS
    # test building with pkg-config<commit_msg>ignition-msgs1: rebuild after protobuf bump (#1962)<commit_after>class IgnitionMsgs1 < Formula
  desc "Middleware protobuf messages for robotics"
  homepage "https://github.com/gazebosim/gz-msgs"
  url "https://osrf-distributions.s3.amazonaws.com/ign-msgs/releases/ignition-msgs-1.0.0.tar.bz2"
  sha256 "fed54d079a58087fa83cc871f01ba2919866292ba949b6b8f37a0cb3d7186b4b"
  license "Apache-2.0"
  revision 17
  version_scheme 1

  head "https://github.com/gazebosim/gz-msgs.git", branch: "ign-msgs1"

  bottle do
    root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
    sha256 cellar: :any, big_sur:  "477b93c40f062c1908c4dce3d486dea4176b3b21e7cfd5cd40628f7a37f55ac5"
    sha256 cellar: :any, catalina: "0376b7541f4d714b40edc7c588c97ee00bb9bfaf2c3fa646a34c26baa40f12ae"
  end

  depends_on "protobuf-c" => :build
  depends_on "cmake"
  depends_on "ignition-cmake0"
  depends_on "ignition-math4"
  depends_on "pkg-config"
  depends_on "protobuf"
  depends_on "ignition-tools" => :recommended

  patch do
    # Fix compilation: add missing std namespace
    # https://github.com/gazebosim/gz-msgs/pull/242
    # TODO: remove with next major release
    url "https://github.com/gazebosim/gz-msgs/commit/88386e4e7a38d0ccb0a96f9774ba5339bc7e5440.patch?full_index=1"
    sha256 "2cc0cb1887a1c9f945f80f7fcee5f4f1719d914e1134b44254b5718383ff6263"
  end

  def install
    cmake_args = std_cmake_args
    cmake_args << "-DBUILD_TESTING=Off"
    cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}"

    mkdir "build" do
      system "cmake", "..", *cmake_args
      system "make", "install"
    end
  end

  test do
    (testpath/"test.cpp").write <<-EOS
      #include <ignition/msgs.hh>
      int main() {
        ignition::msgs::UInt32;
        return 0;
      }
    EOS
    (testpath/"CMakeLists.txt").write <<-EOS
      cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
      find_package(ignition-msgs1 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-msgs1::ignition-msgs1)
    EOS
    # test building with pkg-config
{'fraction_non_alphanumeric': 0.11206225680933853, 'fraction_numerical': 0.07652399481193256, 'mean_word_length': 3.9499358151476254, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 9, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4978195', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1529, 'n_words': 229}