websocketpp 0.8.2 (new formula)

websocket library, depends on boost

Closes #94617.

Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
Maximilian Schneider 2022-02-07 01:37:47 +01:00 committed by BrewTestBot
parent 1b13806a38
commit 3b95a8ad1a
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 39 additions and 0 deletions

39
Formula/websocketpp.rb Normal file
View File

@ -0,0 +1,39 @@
class Websocketpp < Formula
desc "WebSocket++ is a cross platform header only C++ library"
homepage "https://www.zaphoyd.com/websocketpp"
url "https://github.com/zaphoyd/websocketpp/archive/refs/tags/0.8.2.tar.gz"
sha256 "6ce889d85ecdc2d8fa07408d6787e7352510750daa66b5ad44aacb47bea76755"
license "BSD-3-Clause"
depends_on "cmake" => :build
depends_on "boost"
def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <stdio.h>
#include <websocketpp/config/asio_no_tls_client.hpp>
#include <websocketpp/client.hpp>
typedef websocketpp::client<websocketpp::config::asio_client> client;
int main(int argc, char ** argv)
{
client c;
try {
c.init_asio();
return 0;
} catch (websocketpp::exception const & e) {
std::cout << e.what() << std::endl;
return 1;
}
}
EOS
system ENV.cxx, "test.cpp", "-std=c++11", "-L#{Formula["boost"].opt_lib}",
"-lboost_random", "-pthread", "-o", "test"
system "./test"
end
end