From 8a095b01d735e238f3787bcbd6f11209aab1c5ac Mon Sep 17 00:00:00 2001 From: Sergey Tarasov Date: Sat, 4 Nov 2023 00:31:24 +0200 Subject: [PATCH] Add curl-impersonate --- Formula/curl-impersonate.rb | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Formula/curl-impersonate.rb diff --git a/Formula/curl-impersonate.rb b/Formula/curl-impersonate.rb new file mode 100644 index 0000000..29af648 --- /dev/null +++ b/Formula/curl-impersonate.rb @@ -0,0 +1,46 @@ +class CurlImpersonate < Formula + desc "Impersonate version of curl" + homepage "https://github.com/lwthiker/curl-impersonate" + url "https://github.com/lwthiker/curl-impersonate/archive/refs/tags/v0.6.0-alpha.1.tar.gz" + sha256 "b6e6ae6a418695f2fb8f45a36540866a958a5070fa4c2c54849d6946ed5eae10" + license "MIT" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "cmake" => :build + depends_on "libtool" => :build + depends_on "make" => :build + depends_on "ninja" => :build + + depends_on "go" # for chrome only + depends_on "libidn2" + depends_on "rtmpdump" + depends_on "zstd" + + def install + inreplace "configure", %r{/usr/local}, prefix + + mkdir "build" do + system "../configure" + + ENV.deparallelize do + system "gmake", "chrome-build" + end + + system "gmake", "chrome-checkbuild" + + system "gmake", "chrome-install" + end + end + + test do + version = shell_output("#{bin}/curl-impersonate-chrome --version") + + # same as in chrome-checkbuild + assert_match "libcurl", version + assert_match "zlib", version + assert_match "brotli", version + assert_match "nghttp2", version + assert_match "BoringSSL", version + end +end