Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmsquic 2.4.4 (new formula) #192082

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions Formula/lib/libmsquic.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
class Libmsquic < Formula
desc "Cross-platform, C implementation of the IETF QUIC protocol"
homepage "https://github.com/microsoft/msquic"
url "https://github.com/microsoft/msquic.git",
tag: "v2.4.4",
revision: "e87ae9a37bcebdf5ab3725e5d882ddb50e4dbbb4"
license "MIT"

depends_on "cmake" => :build
depends_on "openssl@3"

def install
args = %w[
-DQUIC_TLS=openssl3
-DQUIC_USE_SYSTEM_LIBCRYPTO=true
-DQUIC_BUILD_PERF=OFF
-DQUIC_BUILD_TOOLS=OFF
-DQUIC_BUILD_TESTS=OFF
-DHOMEBREW_ALLOW_FETCHCONTENT=ON
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS
]

system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

test do
example = testpath/"example.cpp"
example.write <<~EOS
#include <iostream>
#include <msquic.h>

int main()
{
const QUIC_API_TABLE * ptr = {nullptr};
if (auto status = MsQuicOpen2(&ptr); QUIC_FAILED(status))
{
std::cout << "MsQuicOpen2 failed: " << status << std::endl;
return 1;
}

std::cout << "MsQuicOpen2 succeeded";
MsQuicClose(ptr);
return 0;
}
EOS
system ENV.cxx, example, "-I#{include}", "-L#{lib}", "-lmsquic", "-o", "test"
assert_equal "MsQuicOpen2 succeeded", shell_output("./test").strip
end
end
Loading