1
1
class SqlbOpensslAT3 < Formula
2
2
desc "Cryptography and SSL/TLS Toolkit"
3
3
homepage "https://openssl.org/"
4
- version "3.4.1"
5
- url "https://github.com/openssl/openssl/releases/download/openssl-#{ version } /openssl-#{ version } .tar.gz"
6
- mirror "https://www.openssl.org/source/openssl-#{ version } .tar.gz"
7
- mirror "http://fresh-center.net/linux/misc/openssl-#{ version } .tar.gz"
4
+ url "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz"
5
+ # version "3.4.1"
8
6
sha256 "002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3"
9
7
license "Apache-2.0"
10
8
11
- bottle do
12
- root_url "https://nightlies.sqlitebrowser.org/homebrew_bottles"
13
- rebuild 1
14
- sha256 arm64_sonoma : "e20ffdf75d17960f7cdc715481419e15314136215e800c37a2a572925d2d44fb"
15
- end
16
-
17
9
livecheck do
18
10
url "https://www.openssl.org/source/"
19
11
regex ( /href=.*?openssl[._-]v?(\d +(?:\. \d +)+)\. t/i )
20
12
end
21
13
14
+ bottle do
15
+ root_url "https://github.com/lucydodo/homebrew-tap/releases/download/sqlb-openssl@3-3.4.1"
16
+ sha256 arm64_sonoma : "6da840dda45af0f56f1f2de196ac34617cb16df15b1db2dedaf8661efac52820"
17
+ end
18
+
22
19
keg_only :shadowed_by_macos , "macOS provides LibreSSL"
23
20
24
21
depends_on arch : :arm64
@@ -29,7 +26,7 @@ class SqlbOpensslAT3 < Formula
29
26
# be obvious to everyone, so explicitly state it for now to
30
27
# help debug inevitable breakage.
31
28
def configure_args
32
- args = %W [
29
+ %w [
33
30
enable-ec_nistp_64_gcc_128
34
31
no-asm
35
32
no-ssl3
@@ -61,7 +58,7 @@ def install
61
58
ENV . append "CFLAGS" , "-arch x86_64"
62
59
63
60
system "perl" , "./Configure" , *( configure_args + arch_args )
64
- system "arch -x86_64 make"
61
+ system "arch" , " -x86_64" , " make"
65
62
system "make" , "install" , "MANDIR=#{ prefix } /darwin64-x86_64-cc/share/man" , "MANSUFFIX=ssl"
66
63
# AF_ALG support isn't always enabled (e.g. some containers), which breaks the tests.
67
64
# AF_ALG is a kernel feature and failures are unlikely to be issues with the formula.
@@ -72,29 +69,30 @@ def install
72
69
arch_args += %W[ --prefix=#{ prefix } --openssldir=#{ openssldir } --libdir=lib ]
73
70
74
71
openssldir . mkpath
75
- system "make clean"
72
+ system "make" , " clean"
76
73
system "perl" , "./Configure" , *( configure_args + arch_args )
77
74
system "make"
78
75
system "make" , "install" , "MANDIR=#{ man } " , "MANSUFFIX=ssl"
79
76
# # AF_ALG support isn't always enabled (e.g. some containers), which breaks the tests.
80
77
# # AF_ALG is a kernel feature and failures are unlikely to be issues with the formula.
81
78
# system "make", "test", "TESTS=-test_afalg"
82
79
83
- system "lipo" , "-create" , "-output" , "#{ lib } /libcrypto.3.dylib" , "#{ lib } /libcrypto.3.dylib" , "#{ prefix } /darwin64-x86_64-cc/lib/libcrypto.3.dylib"
84
- system "lipo" , "-create" , "-output" , "#{ lib } /libcrypto.a" , "#{ lib } /libcrypto.a" , "#{ prefix } /darwin64-x86_64-cc/lib/libcrypto.a"
80
+ mv "#{ lib } /libcrypto.3.dylib" , "#{ lib } /libcrypto.3-arm64.dylib"
81
+ dylib_arm64 = MachO ::MachOFile . new ( "#{ lib } /libcrypto.3-arm64.dylib" )
82
+ dylib_x86_64 = MachO ::MachOFile . new ( "#{ prefix } /darwin64-x86_64-cc/lib/libcrypto.3.dylib" )
83
+ fat = MachO ::FatFile . new_from_machos ( dylib_arm64 , dylib_x86_64 )
84
+ fat . write ( "#{ lib } /libcrypto.3.dylib" )
85
+
85
86
rm "#{ lib } /libcrypto.dylib"
87
+ rm_r "#{ prefix } /darwin64-x86_64-cc/bin"
88
+ rm_r "#{ prefix } /darwin64-x86_64-cc/lib"
86
89
ln_s "#{ lib } /libcrypto.3.dylib" , "#{ lib } /libcrypto.dylib"
87
90
end
88
91
89
92
def openssldir
90
93
etc /"sqlb-openssl@3"
91
94
end
92
95
93
- def post_install
94
- rm_f openssldir /"cert.pem"
95
- openssldir . install_symlink Formula [ "ca-certificates" ] . pkgetc /"cert.pem"
96
- end
97
-
98
96
def caveats
99
97
<<~EOS
100
98
A CA file has been bootstrapped using certificates from the system
@@ -108,8 +106,7 @@ def caveats
108
106
109
107
test do
110
108
# Make sure the necessary .cnf file exists, otherwise OpenSSL gets moody.
111
- assert_predicate pkgetc /"openssl.cnf" , :exist? ,
112
- "OpenSSL requires the .cnf file for some functionality"
109
+ assert_path_exists pkgetc /"openssl.cnf" , "OpenSSL requires the .cnf file for some functionality"
113
110
114
111
# Check OpenSSL itself functions as expected.
115
112
( testpath /"testfile.txt" ) . write ( "This is a test file" )
0 commit comments