From 50b141c6f703a358a79387d28825b6e8869989d5 Mon Sep 17 00:00:00 2001 From: Guo Xiao Date: Tue, 13 Jan 2015 14:30:02 +0800 Subject: [PATCH] cpp-netlib 0.11.1 final (new formula) Closes Homebrew/homebrew#35804. Signed-off-by: Mike McQuaid --- Formula/cpp-netlib.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Formula/cpp-netlib.rb diff --git a/Formula/cpp-netlib.rb b/Formula/cpp-netlib.rb new file mode 100644 index 0000000000..1c28d39c08 --- /dev/null +++ b/Formula/cpp-netlib.rb @@ -0,0 +1,31 @@ +class CppNetlib < Formula + homepage "http://cpp-netlib.org" + url "https://storage.googleapis.com/cpp-netlib-downloads/0.11.1/cpp-netlib-0.11.1-final.tar.bz2" + sha1 "213ba700e534596b44409cd6d5738b959fe41746" + + depends_on "cmake" => :build + depends_on "boost" => "c++11" + needs :cxx11 + + def install + ENV.cxx11 + system "cmake", ".", *std_cmake_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.cpp").write <<-EOS.undent + #include + int main(int argc, char *argv[]) { + using namespace boost::network; + http::client client; + http::client::request request(""); + return 0; + } + EOS + flags = ["-stdlib=libc++", "-I#{include}", "-I#{Formula["boost"].include}", "-L#{lib}", "-L#{Formula["boost"].lib}", "-lboost_thread-mt", "-lboost_system-mt", "-lssl", "-lcrypto", "-lcppnetlib-client-connections", "-lcppnetlib-server-parsers", "-lcppnetlib-uri"] + ENV.cflags.to_s.split + system ENV.cxx, "-o", "test", "test.cpp", *flags + system "./test" + end +end