class Lcm < Formula desc "Libraries and tools for message passing and data marshalling" homepage "https://lcm-proj.github.io/" url "https://github.com/lcm-proj/lcm/releases/download/v1.4.0/lcm-1.4.0.zip" sha256 "e249d7be0b8da35df8931899c4a332231aedaeb43238741ae66dc9baf4c3d186" revision 1 head "https://github.com/lcm-proj/lcm.git" bottle do cellar :any sha256 "52b944b19684bf87d7e688746f0fd6e228592cbbe0b573b8a7bed8a992a58352" => :catalina sha256 "6cef0f13a3d16fc22eec7e49723f912abeb1e6d8f86aa1ce30cbd7fef422081c" => :mojave sha256 "508d932a8eec5be9f8e70baaf17aa9c03dcf28228880f1a88ff797fea77deea1" => :high_sierra end depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "glib" depends_on :java => "1.8+" depends_on "python" def install args = std_cmake_args + %W[ -DLCM_ENABLE_EXAMPLES=OFF -DLCM_ENABLE_TESTS=OFF -DLCM_JAVA_TARGET_VERSION=8 -DPYTHON_EXECUTABLE=#{Formula["python"].opt_bin}/python3 ] mkdir "build" do system "cmake", *args, ".." system "make" system "make", "install" end end test do (testpath/"example_t.lcm").write <<~EOS package exlcm; struct example_t { int64_t timestamp; double position[3]; string name; } EOS system bin/"lcm-gen", "-c", "example_t.lcm" assert_predicate testpath/"exlcm_example_t.h", :exist?, "lcm-gen did not generate C header file" assert_predicate testpath/"exlcm_example_t.c", :exist?, "lcm-gen did not generate C source file" system bin/"lcm-gen", "-x", "example_t.lcm" assert_predicate testpath/"exlcm/example_t.hpp", :exist?, "lcm-gen did not generate C++ header file" system bin/"lcm-gen", "-j", "example_t.lcm" assert_predicate testpath/"exlcm/example_t.java", :exist?, "lcm-gen did not generate Java source file" system bin/"lcm-gen", "-p", "example_t.lcm" assert_predicate testpath/"exlcm/example_t.py", :exist?, "lcm-gen did not generate Python source file" end end