60 lines
2.1 KiB
Ruby
60 lines
2.1 KiB
Ruby
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"
|
|
license "LGPL-2.1"
|
|
revision 5
|
|
head "https://github.com/lcm-proj/lcm.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "28d85d3e3f95b63178093c7032ded0e3ce2d057365bb92ab0e16901b58fc60a2" => :big_sur
|
|
sha256 "a19a78d14fcab20e29c3a8e8e4e285918ea2ebec2141b9f517f819aaf5c97096" => :catalina
|
|
sha256 "997c8ace421b510f5f7094ca651aceba9929390e5885e2cbe992fe62df7cc7f9" => :mojave
|
|
sha256 "aeaad1129d679ee067c8270e62e86fd2a32c7bee3b110a8f84b9753a42fdb612" => :high_sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "glib"
|
|
depends_on "lua"
|
|
depends_on "openjdk"
|
|
depends_on "python@3.9"
|
|
|
|
def install
|
|
args = std_cmake_args + %W[
|
|
-DLCM_ENABLE_EXAMPLES=OFF
|
|
-DLCM_ENABLE_TESTS=OFF
|
|
-DLCM_JAVA_TARGET_VERSION=8
|
|
-DPYTHON_EXECUTABLE=#{Formula["python@3.9"].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
|