From 94c591113043ce816a23d3d2f110304a642b782e Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Mon, 17 Mar 2014 00:02:20 -0700 Subject: [PATCH] tinyxml2 2.0.2 (new formula) tinyxml2 is a light-weight c++ library for parsing xml. It was previously submitted as a head-only formula in Homebrew/homebrew#23381 but was put on hold until releases could be tagged upstream. The 2.0.2 release has just been tagged. tinyxml2: add test that uses pkg-config to search for library tinyxml2: add basic test for compiling and linking Update tinyxml2.rb Remove pkg-config test. --- Formula/tinyxml2.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Formula/tinyxml2.rb diff --git a/Formula/tinyxml2.rb b/Formula/tinyxml2.rb new file mode 100644 index 00000000000..fbfc358c837 --- /dev/null +++ b/Formula/tinyxml2.rb @@ -0,0 +1,26 @@ +require "formula" + +class Tinyxml2 < Formula + homepage "http://grinninglizard.com/tinyxml2" + url "https://github.com/leethomason/tinyxml2/archive/2.0.2.tar.gz" + sha1 "c78a4de58540e2a35f4775fd3e577299ebd15117" + head "https://github.com/leethomason/tinyxml2.git", :branch => "master" + + depends_on "cmake" => :build + + def install + system "cmake", ".", *std_cmake_args + system "make", "install" + end + + test do + (testpath/'test.cpp').write <<-EOS.undent + #include + int main() { + tinyxml2::XMLDocument doc (false); + return 0; + } + EOS + system ENV.cc, "test.cpp", "-ltinyxml2" + end +end