homebrew-core/Formula/wolfssl.rb

97 lines
2.6 KiB
Ruby

class Wolfssl < Formula
desc "Embedded SSL Library written in C"
homepage "https://www.wolfssl.com/wolfSSL/Home.html"
url "https://github.com/wolfSSL/wolfssl/archive/v3.8.0.tar.gz"
sha256 "2a1c72c98bd8d473d227f98d0ce970432478e05fbee1ebd8559918b017864199"
head "https://github.com/wolfSSL/wolfssl.git"
bottle do
cellar :any
sha256 "10593229c8096c9a3cc12bf62303fcf19e1c284a092443c3149edabf83e0a7fc" => :el_capitan
sha256 "9ff13ccf54fe773f5a8944efd8de7a6f09c3c16f1189c3732f08f0d1c16209fb" => :yosemite
sha256 "badbb7b60bc963eae7c559c22094c9f225e122e3a1e0ca1686782b6bb3851744" => :mavericks
end
option "without-test", "Skip compile-time tests"
deprecated_option "without-check" => "without-test"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
args = %W[
--disable-silent-rules
--disable-dependency-tracking
--infodir=#{info}
--mandir=#{man}
--prefix=#{prefix}
--sysconfdir=#{etc}
--disable-bump
--disable-examples
--disable-fortress
--disable-md5
--disable-sniffer
--disable-webserver
--enable-aesccm
--enable-aesgcm
--enable-alpn
--enable-blake2
--enable-camellia
--enable-certgen
--enable-certreq
--enable-chacha
--enable-crl
--enable-crl-monitor
--enable-dtls
--enable-dh
--enable-ecc
--enable-eccencrypt
--enable-ecc25519
--enable-ed25519
--enable-filesystem
--enable-hc128
--enable-hkdf
--enable-inline
--enable-ipv6
--enable-keygen
--enable-ocsp
--enable-opensslextra
--enable-poly1305
--enable-psk
--enable-rabbit
--enable-ripemd
--enable-savesession
--enable-savecert
--enable-sessioncerts
--enable-sha512
--enable-sni
--enable-supportedcurves
]
if MacOS.prefer_64_bit?
args << "--enable-fastmath" << "--enable-fasthugemath"
else
args << "--disable-fastmath" << "--disable-fasthugemath"
end
args << "--enable-aesni" if Hardware::CPU.aes? && !build.bottle?
# Extra flag is stated as a needed for the Mac platform.
# https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html
# Also, only applies if fastmath is enabled.
ENV.append_to_cflags "-mdynamic-no-pic" if MacOS.prefer_64_bit?
system "./autogen.sh"
system "./configure", *args
system "make"
system "make", "check" if build.with? "test"
system "make", "install"
end
test do
system bin/"wolfssl-config", "--cflags", "--libs", "--prefix"
end
end