homebrew-core/Formula/wolfssl.rb
2018-11-25 13:05:19 -05:00

105 lines
2.9 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.git",
:tag => "v3.15.5-stable",
:revision => "39506e61d16ef40583f251cafcb63302d22fd7f3"
sha256 "4e15f494604e41725499f8b708798f8ddc2fcaa8f39b4369bcd000b3cab482d8"
head "https://github.com/wolfSSL/wolfssl.git"
bottle do
cellar :any
sha256 "beb57fb2808a63073b9df4b8e263a04b61940da8b044892c390b16bec249cdc5" => :mojave
sha256 "c57645d93606b126e25c5b028499903efd524dd85fd7fe08560c338eb891f93a" => :high_sierra
sha256 "13f656f75a2f877910803de4a55b15ea449c8093c0a2e69e1baa8c440ecdf9a8" => :sierra
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
# https://github.com/Homebrew/homebrew-core/pull/1046
# https://github.com/Homebrew/brew/pull/251
ENV.delete("SDKROOT")
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-curve25519
--enable-dtls
--enable-dh
--enable-ecc
--enable-eccencrypt
--enable-ed25519
--enable-filesystem
--enable-hc128
--enable-hkdf
--enable-inline
--enable-ipv6
--enable-jni
--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
--enable-tls13
--enable-sp
]
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