forked from denji/homebrew-nginx
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathopenresty-openssl111.rb
65 lines (55 loc) · 2.17 KB
/
openresty-openssl111.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
class OpenrestyOpenssl111 < Formula
desc "This OpenSSL 1.1.1 library build is specifically for OpenResty uses"
homepage "https://www.openssl.org/"
VERSION = "1.1.1w".freeze
revision 1
stable do
url "https://www.openssl.org/source/openssl-#{VERSION}.tar.gz"
mirror "https://openresty.org/download/openssl-#{VERSION}.tar.gz"
sha256 "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8"
patch do
url "https://raw.githubusercontent.com/openresty/openresty/master/patches/openssl-1.1.1f-sess_set_get_cb_yield.patch"
sha256 "d289aa9464552f8caf19de01732ad06832f5f7decaaa4a1eb8c3034ed8a155eb"
end
end
keg_only "only for use with OpenResty"
# Only needs 5.10 to run, but needs >5.13.4 to run the testsuite.
# https://github.com/openssl/openssl/blob/4b16fa791d3ad8/README.PERL
# The MacOS ML tag is same hack as the way we handle most :python deps.
depends_on "perl" if build.with?("test") && MacOS.version <= :mountain_lion
# SSLv2 died with 1.1.0, so no-ssl2 no longer required.
# SSLv3 & zlib are off by default with 1.1.0 but this may not
# be obvious to everyone, so explicitly state it for now to
# help debug inevitable breakage.
def configure_args; %W[
--prefix=#{prefix}
--openssldir=#{openssldir}
--libdir=lib
no-threads
shared
zlib
-g
enable-ssl3
enable-ssl3-method
]
end
def install
# This could interfere with how we expect OpenSSL to build.
ENV.delete("OPENSSL_LOCAL_CONFIG_DIR")
# This ensures where Homebrew's Perl is needed the Cellar path isn't
# hardcoded into OpenSSL's scripts, causing them to break every Perl update.
# Whilst our env points to opt_bin, by default OpenSSL resolves the symlink.
if which("perl") == Formula["perl"].opt_bin/"perl"
ENV["PERL"] = Formula["perl"].opt_bin/"perl"
end
arch_args = %W[darwin64-#{Hardware::CPU.arch}-cc enable-ec_nistp_64_gcc_128]
#ENV.deparallelize
system "perl", "./Configure", *(configure_args + arch_args)
system "make"
system "make", "test" if build.with?("test")
system "make", "install", "MANDIR=#{man}", "MANSUFFIX=ssl"
end
def openssldir
etc/"openssl@1.1.1"
end
end