class CurlOpenssl < Formula desc "Get a file from an HTTP, HTTPS or FTP server" homepage "https://curl.haxx.se/" url "https://curl.haxx.se/download/curl-7.62.0.tar.bz2" mirror "http://curl.mirror.anstey.ca/curl-7.62.0.tar.bz2" sha256 "7802c54076500be500b171fde786258579d60547a3a35b8c5a23d8c88e8f9620" bottle do sha256 "112be7d63c2abdcd39ba9f9ddf240a8bb2960ab52b5393d7e3e01ad6df17b7c8" => :mojave sha256 "4e259d94c1772d30bfd0cd5941e53b4fcf065995437366d3354b1deae323c3bb" => :high_sierra sha256 "f4b877589a4882431bc9394e876472e96cab07815654e880648fc74b3ed54685" => :sierra end keg_only :provided_by_macos depends_on "pkg-config" => :build depends_on "brotli" depends_on "nghttp2" depends_on "openldap" depends_on "openssl" def install # Allow to build on Lion, lowering from the upstream setting of 10.8 ENV.append_to_cflags "-mmacosx-version-min=10.7" if MacOS.version <= :lion args = %W[ --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=#{prefix} --disable-ares --with-ca-bundle=#{etc}/openssl/cert.pem --with-ca-path=#{etc}/openssl/certs --with-gssapi --without-libidn2 --without-libmetalink --without-librtmp --without-libssh2 --with-ssl=#{Formula["openssl"].opt_prefix} ] system "./configure", *args system "make", "install" 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