2015-01-13 06:30:02 +00:00
|
|
|
class CppNetlib < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "C++ libraries for high level network programming"
|
2015-01-13 06:30:02 +00:00
|
|
|
homepage "http://cpp-netlib.org"
|
2015-08-30 07:44:39 +00:00
|
|
|
url "http://downloads.cpp-netlib.org/0.11.2/cpp-netlib-0.11.2-final.tar.gz"
|
|
|
|
version "0.11.2"
|
|
|
|
sha256 "71953379c5a6fab618cbda9ac6639d87b35cab0600a4450a7392bc08c930f2b1"
|
2015-01-13 07:40:13 +00:00
|
|
|
|
2015-05-10 02:05:19 +00:00
|
|
|
bottle do
|
2015-09-22 11:50:24 +00:00
|
|
|
cellar :any_skip_relocation
|
|
|
|
sha256 "5669a528afe56b310179af07d0191b96491f90a2365b5b9e7f1d26daa011b463" => :el_capitan
|
2015-08-30 08:17:01 +00:00
|
|
|
sha256 "2ddb407f33dd6a8c8ec1e3a8afd67a3afb1666f843794e72632f203fb5b42ecb" => :yosemite
|
|
|
|
sha256 "0913efd07660f359ee7d043f06a25ccb9fc3010f42b15f4dbd43b558f2161bb1" => :mavericks
|
|
|
|
sha256 "093cc615abf08eeb6d698d85e9d4bb8003e536548f925246d86baa7f1ec45506" => :mountain_lion
|
2015-05-10 02:05:19 +00:00
|
|
|
end
|
|
|
|
|
2015-01-13 06:30:02 +00:00
|
|
|
depends_on "cmake" => :build
|
2015-08-04 02:34:01 +00:00
|
|
|
depends_on "openssl"
|
2015-05-03 18:30:18 +00:00
|
|
|
|
|
|
|
if MacOS.version < :mavericks
|
|
|
|
depends_on "boost" => "c++11"
|
|
|
|
else
|
|
|
|
depends_on "boost"
|
|
|
|
end
|
|
|
|
|
2015-01-13 06:30:02 +00:00
|
|
|
needs :cxx11
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.cxx11
|
2015-08-04 02:34:01 +00:00
|
|
|
|
|
|
|
system "cmake", *std_cmake_args
|
2015-01-13 06:30:02 +00:00
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
2015-08-04 02:34:01 +00:00
|
|
|
#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;
|
|
|
|
}
|
2015-01-13 06:30:02 +00:00
|
|
|
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
|