diff options
| author | Jonathan Dahan | 2014-08-21 14:58:11 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-08-21 14:58:11 -0500 |
| commit | ce431b251f7059e2d571a4eb3791b5c214f09aea (patch) | |
| tree | fd38725c30b1912729f11680ac0fec5bed3184d5 /Library | |
| parent | c01e6827cdad13a53ce55c679f4dca96905363d2 (diff) | |
| download | homebrew-ce431b251f7059e2d571a4eb3791b5c214f09aea.tar.bz2 | |
New formula: libtins
Closes #31399.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/libtins.rb | 31 |
1 files changed, 31 insertions, 0 deletions
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 <tins/tins.h> + int main() { + Tins::Sniffer sniffer("en0"); + } + EOS + system ENV.cxx, "test.cpp", "-ltins", "-o", "test" + end + +end |
