Skip to content

Commit 86e9c2c

Browse files
committed
Resolve issues detected by brew audit --strict
1 parent 2cc30aa commit 86e9c2c

File tree

4 files changed

+51
-53
lines changed

4 files changed

+51
-53
lines changed

Formula/sqlb-openssl@3.rb

+19-22
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
class 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")

Formula/sqlb-qt@5.rb

+12-14
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,27 @@
33
class SqlbQtAT5 < Formula
44
desc "Cross-platform application and UI framework"
55
homepage "https://www.qt.io/"
6-
version "5.15.16"
7-
# NOTE: Use *.diff for GitLab/KDE patches to avoid their checksums changing.
86
url "https://download.qt.io/official_releases/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz"
9-
mirror "https://mirrors.dotsrc.org/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz"
10-
mirror "https://mirrors.ocf.berkeley.edu/qt/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz"
7+
# version "5.15.16"
8+
# NOTE: Use *.diff for GitLab/KDE patches to avoid their checksums changing.
119
sha256 "efa99827027782974356aceff8a52bd3d2a8a93a54dd0db4cca41b5e35f1041c"
1210
license all_of: ["GFDL-1.3-only", "GPL-2.0-only", "GPL-3.0-only", "LGPL-2.1-only", "LGPL-3.0-only"]
1311
revision 1
1412

15-
bottle do
16-
root_url "https://nightlies.sqlitebrowser.org/homebrew_bottles"
17-
rebuild 1
18-
sha256 cellar: :any, arm64_sonoma: "3c66b0d432cc737db11850de9b6ce7c84f20a0dedf54e950d10246cd4808ccdf"
19-
end
20-
2113
livecheck do
2214
url "https://download.qt.io/official_releases/qt/5.15/"
2315
regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i)
2416
end
2517

26-
depends_on arch: :arm64
18+
bottle do
19+
root_url "https://github.com/lucydodo/homebrew-tap/releases/download/sqlb-qt@5-5.15.16_1"
20+
sha256 cellar: :any, arm64_sonoma: "be4927a0d13ae0decd8b1ad449adf3d0290e57b14505d0fcc3e7d4f2895ea2fc"
21+
end
22+
2723
keg_only :versioned_formula
2824

25+
depends_on arch: :arm64
26+
2927
# Fix build with Xcode 14.3.
3028
# https://bugreports.qt.io/browse/QTBUG-112906
3129
patch do
@@ -47,7 +45,7 @@ class SqlbQtAT5 < Formula
4745
directory "qtbase"
4846
end
4947

50-
# CVE-2024-25580
48+
# CVE-2024-25580
5149
# Remove with Qt 5.15.17
5250
patch do
5351
url "https://download.qt.io/official_releases/qt/5.15/CVE-2024-25580-qtbase-5.15.diff"
@@ -190,8 +188,8 @@ def caveats
190188

191189
system bin/"qmake", testpath/"hello.pro"
192190
system "make"
193-
assert_predicate testpath/"hello", :exist?
194-
assert_predicate testpath/"main.o", :exist?
191+
assert_path_exists testpath/"hello"
192+
assert_path_exists testpath/"main.o"
195193
system "./hello"
196194
end
197195
end

Formula/sqlb-sqlcipher.rb

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
class SqlbSqlcipher < Formula
22
desc "SQLite extension providing 256-bit AES encryption"
33
homepage "https://www.zetetic.net/sqlcipher/"
4-
version "4.6.1"
5-
url "https://github.com/sqlcipher/sqlcipher/archive/refs/tags/v#{version}.tar.gz"
4+
url "https://github.com/sqlcipher/sqlcipher/archive/refs/tags/v4.6.1.tar.gz"
5+
# version "4.6.1"
66
sha256 "d8f9afcbc2f4b55e316ca4ada4425daf3d0b4aab25f45e11a802ae422b9f53a3"
77
license "BSD-3-Clause"
88
head "https://github.com/sqlcipher/sqlcipher.git", branch: "master"
99

10-
bottle do
11-
root_url "https://nightlies.sqlitebrowser.org/homebrew_bottles"
12-
rebuild 1
13-
sha256 arm64_sonoma: "ff81df0c7205ada240dfa3ea9fc29e11882b11ed1625b00b4b6cf3853d555084"
14-
end
15-
1610
livecheck do
1711
url :stable
1812
strategy :github_latest
1913
end
2014

15+
bottle do
16+
root_url "https://github.com/lucydodo/homebrew-tap/releases/download/sqlb-sqlcipher-4.6.1"
17+
sha256 cellar: :any, arm64_sonoma: "1c3b07faf269425e957a21ce0835e00339a4442d9533e89f7e0781e449804da8"
18+
end
19+
2120
depends_on arch: :arm64
2221
depends_on "sqlb-openssl@3"
2322

@@ -62,7 +61,7 @@ def install
6261
args << "CFLAGS=#{cflags}"
6362

6463
system "./configure", *args
65-
system "arch -x86_64 make"
64+
system "arch", "-x86_64", "make"
6665
system "make", "install"
6766

6867
ENV.delete("CFLAGS")
@@ -93,14 +92,19 @@ def install
9392
].join(" ")
9493
args << "CFLAGS=#{cflags}"
9594

96-
system "make clean"
95+
system "make", "clean"
9796
system "./configure", *args
9897
system "make"
9998
system "make", "install"
10099

101-
system "lipo", "-create", "-output", "#{lib}/libsqlcipher.0.dylib", "#{lib}/libsqlcipher.0.dylib", "#{prefix}/darwin64-x86_64-cc/lib/libsqlcipher.0.dylib"
102-
system "lipo", "-create", "-output", "#{lib}/libsqlcipher.a", "#{lib}/libsqlcipher.a", "#{prefix}/darwin64-x86_64-cc/lib/libsqlcipher.a"
100+
mv "#{lib}/libsqlcipher.0.dylib", "#{lib}/libsqlcipher.0-arm64.dylib"
101+
dylib_arm64 = MachO::MachOFile.new("#{lib}/libsqlcipher.0-arm64.dylib")
102+
dylib_x86_64 = MachO::MachOFile.new("#{prefix}/darwin64-x86_64-cc/lib/libsqlcipher.0.dylib")
103+
fat = MachO::FatFile.new_from_machos(dylib_arm64, dylib_x86_64)
104+
fat.write("#{lib}/libsqlcipher.0.dylib")
105+
103106
rm "#{lib}/libsqlcipher.dylib"
107+
rm_r "#{prefix}/darwin64-x86_64-cc"
104108
ln_s "#{lib}/libsqlcipher.0.dylib", "#{lib}/libsqlcipher.dylib"
105109
end
106110

Formula/sqlb-sqlite.rb

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ class SqlbSqlite < Formula
55
version "3.48.0"
66
sha256 "ac992f7fca3989de7ed1fe99c16363f848794c8c32a158dafd4eb927a2e02fd5"
77
license "blessing"
8-
env :std
98

109
bottle do
11-
root_url "https://nightlies.sqlitebrowser.org/homebrew_bottles"
12-
rebuild 1
13-
sha256 cellar: :any, arm64_sonoma: "e6b03a12f5d0392595b99b1564dbbc027f4517fcc578517be2b0641985f4a9e9"
10+
root_url "https://github.com/lucydodo/homebrew-tap/releases/download/sqlb-sqlite-3.48.0"
11+
sha256 cellar: :any, arm64_sonoma: "90e6a864154e6089ff1cfaacc5e589efae5cc844b47369174a8ebb04039f843b"
1412
end
13+
env :std
1514

1615
livecheck do
1716
url :homepage
@@ -21,7 +20,7 @@ class SqlbSqlite < Formula
2120
end
2221
end
2322

24-
keg_only :provided_by_macos
23+
keg_only :shadowed_by_macos
2524

2625
depends_on arch: :arm64
2726

0 commit comments

Comments
 (0)