libplctag 1.5.8 (new formula)

Closes #27489.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Simone Contini 2018-05-04 11:26:13 +02:00 committed by FX Coudert
parent 1780b47b4a
commit d20c13bd16

29
Formula/libplctag.rb Normal file
View file

@ -0,0 +1,29 @@
class Libplctag < Formula
desc "Portable and simple API for accessing AB PLC data over Ethernet"
homepage "https://github.com/kyle-github/libplctag"
url "https://github.com/kyle-github/libplctag/archive/v1.5.8.tar.gz"
sha256 "03847aeb4bdbfad255e62feff029b9b0c81758e66b840237023243b1c1b764ec"
depends_on "cmake" => :build
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <stdlib.h>
#include <libplctag.h>
int main(int argc, char **argv) {
plc_tag tag = plc_tag_create("protocol=ab_eip&gateway=192.168.1.42&path=1,0&cpu=LGX&elem_size=4&elem_count=10&name=myDINTArray");
if (!tag) abort();
plc_tag_destroy(tag);
return 0;
}
EOS
system ENV.cc, "test.c", "-lplctag", "-o", "test"
system "./test"
end
end