homebrew-core/Formula/curl.rb

101 lines
2.8 KiB
Ruby

class Curl < Formula
desc "Get a file from an HTTP, HTTPS or FTP server"
homepage "https://curl.se"
license "curl"
revision 1
stable do
url "https://curl.se/download/curl-7.76.1.tar.bz2"
sha256 "7a8e184d7d31312c4ebf6a8cb59cd757e61b2b2833a9ed4f9bf708066e7695e9"
patch do
url "https://github.com/curl/curl/commit/8bdde6b14ce3b5fd71c772a578fcbd4b6fa6df19.patch?full_index=1"
sha256 "4da7b91474583c563dcabb039405423dbaf0e1df92ce97bbe6726bcfdb67e602"
end
end
livecheck do
url "https://curl.se/download/"
regex(/href=.*?curl[._-]v?(.*?)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "04dd02baef28b4d4a3b03700a8a9ac8c08f413bd2f49b15e312340793ea435f8"
sha256 cellar: :any, big_sur: "ebd3c6a3797ef3851a4b5976360368ed0d74d460a73c4302abb4589dbeac45a2"
sha256 cellar: :any, catalina: "2b6a03437d62e53fb70f2ed195fe1a661ee91657601c8280fb79202ee0d86d18"
sha256 cellar: :any, mojave: "cc4c94713a8b34de386285a1579238f983c59e02a9ae109a54b919435fb72728"
end
head do
url "https://github.com/curl/curl.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
keg_only :provided_by_macos
depends_on "pkg-config" => :build
depends_on "brotli"
depends_on "libidn2"
depends_on "libmetalink"
depends_on "libssh2"
depends_on "nghttp2"
depends_on "openldap"
depends_on "openssl@1.1"
depends_on "rtmpdump"
depends_on "zstd"
uses_from_macos "krb5"
uses_from_macos "zlib"
def install
system "./buildconf" if build.head?
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--with-ssl=#{Formula["openssl@1.1"].opt_prefix}
--without-ca-bundle
--without-ca-path
--with-ca-fallback
--with-secure-transport
--with-default-ssl-backend=openssl
--with-gssapi
--with-libidn2
--with-libmetalink
--with-librtmp
--with-libssh2
--without-libpsl
]
on_macos do
args << "--with-gssapi"
end
on_linux do
args << "--with-gssapi=#{Formula["krb5"].opt_prefix}"
end
system "./configure", *args
system "make", "install"
system "make", "install", "-C", "scripts"
libexec.install "lib/mk-ca-bundle.pl"
end
test do
# Fetch the curl tarball and see that the checksum matches.
# This requires a network connection, but so does Homebrew in general.
filename = (testpath/"test.tar.gz")
system "#{bin}/curl", "-L", stable.url, "-o", filename
filename.verify_checksum stable.checksum
system libexec/"mk-ca-bundle.pl", "test.pem"
assert_predicate testpath/"test.pem", :exist?
assert_predicate testpath/"certdata.txt", :exist?
end
end