diff options
| author | Guo Xiao | 2015-01-13 14:30:02 +0800 | 
|---|---|---|
| committer | Mike McQuaid | 2015-01-13 11:34:12 +0000 | 
| commit | bb0a47d6f8239043bb53ea61cc4c534f2936e8e8 (patch) | |
| tree | bd75c83f22c58d73e4a3d9c7549dd9af6882332e /Library/Formula/cpp-netlib.rb | |
| parent | 3d4e31f76429ad88354dc9064d04b2cd9b067764 (diff) | |
| download | homebrew-bb0a47d6f8239043bb53ea61cc4c534f2936e8e8.tar.bz2 | |
cpp-netlib 0.11.1 final (new formula)
Closes #35804.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/cpp-netlib.rb')
| -rw-r--r-- | Library/Formula/cpp-netlib.rb | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/Library/Formula/cpp-netlib.rb b/Library/Formula/cpp-netlib.rb new file mode 100644 index 000000000..1c28d39c0 --- /dev/null +++ b/Library/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 <boost/network/protocol/http/client.hpp> +        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 | 
