11class SqlbOpensslAT3 < Formula
22 desc "Cryptography and SSL/TLS Toolkit"
33 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"
86 sha256 "002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3"
97 license "Apache-2.0"
108
11- bottle do
12- root_url "https://nightlies.sqlitebrowser.org/homebrew_bottles"
13- rebuild 1
14- sha256 arm64_sonoma : "e20ffdf75d17960f7cdc715481419e15314136215e800c37a2a572925d2d44fb"
15- end
16-
179 livecheck do
1810 url "https://www.openssl.org/source/"
1911 regex ( /href=.*?openssl[._-]v?(\d +(?:\. \d +)+)\. t/i )
2012 end
2113
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+
2219 keg_only :shadowed_by_macos , "macOS provides LibreSSL"
2320
2421 depends_on arch : :arm64
@@ -29,7 +26,7 @@ class SqlbOpensslAT3 < Formula
2926 # be obvious to everyone, so explicitly state it for now to
3027 # help debug inevitable breakage.
3128 def configure_args
32- args = %W [
29+ %w [
3330 enable-ec_nistp_64_gcc_128
3431 no-asm
3532 no-ssl3
@@ -61,7 +58,7 @@ def install
6158 ENV . append "CFLAGS" , "-arch x86_64"
6259
6360 system "perl" , "./Configure" , *( configure_args + arch_args )
64- system "arch -x86_64 make"
61+ system "arch" , " -x86_64" , " make"
6562 system "make" , "install" , "MANDIR=#{ prefix } /darwin64-x86_64-cc/share/man" , "MANSUFFIX=ssl"
6663 # AF_ALG support isn't always enabled (e.g. some containers), which breaks the tests.
6764 # AF_ALG is a kernel feature and failures are unlikely to be issues with the formula.
@@ -72,29 +69,30 @@ def install
7269 arch_args += %W[ --prefix=#{ prefix } --openssldir=#{ openssldir } --libdir=lib ]
7370
7471 openssldir . mkpath
75- system "make clean"
72+ system "make" , " clean"
7673 system "perl" , "./Configure" , *( configure_args + arch_args )
7774 system "make"
7875 system "make" , "install" , "MANDIR=#{ man } " , "MANSUFFIX=ssl"
7976 # # AF_ALG support isn't always enabled (e.g. some containers), which breaks the tests.
8077 # # AF_ALG is a kernel feature and failures are unlikely to be issues with the formula.
8178 # system "make", "test", "TESTS=-test_afalg"
8279
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+
8586 rm "#{ lib } /libcrypto.dylib"
87+ rm_r "#{ prefix } /darwin64-x86_64-cc/bin"
88+ rm_r "#{ prefix } /darwin64-x86_64-cc/lib"
8689 ln_s "#{ lib } /libcrypto.3.dylib" , "#{ lib } /libcrypto.dylib"
8790 end
8891
8992 def openssldir
9093 etc /"sqlb-openssl@3"
9194 end
9295
93- def post_install
94- rm_f openssldir /"cert.pem"
95- openssldir . install_symlink Formula [ "ca-certificates" ] . pkgetc /"cert.pem"
96- end
97-
9896 def caveats
9997 <<~EOS
10098 A CA file has been bootstrapped using certificates from the system
@@ -108,8 +106,7 @@ def caveats
108106
109107 test do
110108 # 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"
113110
114111 # Check OpenSSL itself functions as expected.
115112 ( testpath /"testfile.txt" ) . write ( "This is a test file" )
0 commit comments