From ce431b251f7059e2d571a4eb3791b5c214f09aea Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Thu, 21 Aug 2014 14:58:11 -0500 Subject: New formula: libtins Closes #31399. Signed-off-by: Jack Nagel --- Library/Formula/libtins.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Library/Formula/libtins.rb (limited to 'Library/Formula') diff --git a/Library/Formula/libtins.rb b/Library/Formula/libtins.rb new file mode 100644 index 000000000..e83568df2 --- /dev/null +++ b/Library/Formula/libtins.rb @@ -0,0 +1,31 @@ +require "formula" + +class Libtins < Formula + homepage "https://libtins.github.io/" + url "https://github.com/mfontanini/libtins/archive/v3.0.tar.gz" + sha1 "0e8a31dde9ba9ec55cc4c6d3142fe4e3912598e3" + head "https://github.com/mfontanini/libtins.git" + + option :cxx11 + + def install + ENV.cxx11 if build.cxx11? + args = ["--prefix=#{prefix}"] + args << "--enable-c++11" if build.cxx11? + + system "./configure", *args + system "make", "install" + doc.install "examples" + end + + test do + (testpath/"test.cpp").write <<-EOS.undent + #include + int main() { + Tins::Sniffer sniffer("en0"); + } + EOS + system ENV.cxx, "test.cpp", "-ltins", "-o", "test" + end + +end -- cgit v1.2.3