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"
|
2016-04-11 22:28:23 +00:00
|
|
|
url "https://github.com/cpp-netlib/cpp-netlib/archive/cpp-netlib-0.12.0-final.tar.gz"
|
2016-04-04 09:32:54 +00:00
|
|
|
version "0.12.0"
|
2016-04-11 22:28:23 +00:00
|
|
|
sha256 "d66e264240bf607d51b8d0e743a1fa9d592d96183d27e2abdaf68b0a87e64560"
|
|
|
|
revision 1
|
2015-01-13 07:40:13 +00:00
|
|
|
|
2016-03-20 11:05:26 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-04-12 19:55:13 +00:00
|
|
|
sha256 "1823d6f6dfb79ef8a658ed867ca81f0ba21cd60954633c76585fcba1393954ef" => :el_capitan
|
|
|
|
sha256 "7ab5e0a4dedba2954579394c98211b79680fe55acf8151a3a4ceb49971f27d25" => :yosemite
|
|
|
|
sha256 "0bf00fa7b6f4fc414349b1ae221cd1aede049055b2c68734d9772fb95b73e535" => :mavericks
|
2016-03-20 11:05:26 +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"
|
2016-04-04 09:32:54 +00:00
|
|
|
depends_on "asio"
|
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
|
|
|
|
2016-03-08 05:09:42 +00:00
|
|
|
# NB: Do not build examples or tests as they require submodules.
|
|
|
|
system "cmake", "-DCPP-NETLIB_BUILD_TESTS=OFF", "-DCPP-NETLIB_BUILD_EXAMPLES=OFF", *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[]) {
|
2016-03-08 05:09:42 +00:00
|
|
|
namespace http = boost::network::http;
|
|
|
|
http::client::options options;
|
|
|
|
http::client client(options);
|
2015-08-04 02:34:01 +00:00
|
|
|
http::client::request request("");
|
|
|
|
return 0;
|
|
|
|
}
|
2015-01-13 06:30:02 +00:00
|
|
|
EOS
|
2016-03-08 05:09:42 +00:00
|
|
|
flags = [
|
|
|
|
"-std=c++11",
|
|
|
|
"-stdlib=libc++",
|
|
|
|
"-I#{include}",
|
|
|
|
"-I#{Formula["asio"].include}",
|
|
|
|
"-I#{Formula["boost"].include}",
|
|
|
|
"-L#{lib}",
|
|
|
|
"-L#{Formula["boost"].lib}",
|
|
|
|
"-lssl",
|
|
|
|
"-lcrypto",
|
|
|
|
"-lboost_system-mt",
|
|
|
|
"-lcppnetlib-uri",
|
|
|
|
"-lcppnetlib-client-connections",
|
|
|
|
"-lcppnetlib-server-parsers",
|
|
|
|
] + ENV.cflags.split
|
2015-01-13 06:30:02 +00:00
|
|
|
system ENV.cxx, "-o", "test", "test.cpp", *flags
|
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|