Skip to content

Commit fb4bb76

Browse files
committed
[email protected]: switch to openssl@3
We need to update the openssl gem to do this.
1 parent 305772d commit fb4bb76

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

Formula/[email protected]

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ class RubyAT27 < Formula
44
url "https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.8.tar.xz"
55
sha256 "f22f662da504d49ce2080e446e4bea7008cee11d5ec4858fc69000d0e5b1d7fb"
66
license "Ruby"
7+
revision 1
78

89
livecheck do
910
url "https://www.ruby-lang.org/en/downloads/"
@@ -28,7 +29,7 @@ class RubyAT27 < Formula
2829

2930
depends_on "pkg-config" => :build
3031
depends_on "libyaml"
31-
depends_on "openssl@1.1"
32+
depends_on "openssl@3"
3233
depends_on "readline"
3334

3435
uses_from_macos "libxcrypt"
@@ -42,6 +43,18 @@ class RubyAT27 < Formula
4243
sha256 "55f1c67fa2ae96c9751b81afad5c0f2b3792c5b19cbba6d54d8df9fd821460d3"
4344
end
4445

46+
# Update the bundled openssl gem for compatibility with OpenSSL 3.
47+
resource "openssl" do
48+
url "https://github.com/ruby/openssl/archive/refs/tags/v3.1.0.tar.gz"
49+
sha256 "3f099acd0b3bea791cbdde520f2d332a709bbd9144abcbe22189a20bac12c6de"
50+
end
51+
52+
# Update the bundled digest gem for compatibility with the newer openssl gem.
53+
resource "digest" do
54+
url "https://github.com/ruby/digest/archive/refs/tags/v3.1.1.tar.gz"
55+
sha256 "27107e7a982ce090eb9d84f4fa2f0e537feb46389e5cdd50855f6b8f8531d280"
56+
end
57+
4558
def api_version
4659
Utils.safe_popen_read("#{bin}/ruby", "-e", "print Gem.ruby_api_version")
4760
end
@@ -54,7 +67,24 @@ def install
5467
# otherwise `gem` command breaks
5568
ENV.delete("SDKROOT")
5669

57-
paths = %w[libyaml [email protected] readline].map { |f| Formula[f].opt_prefix }
70+
%w[openssl digest].each do |r_name|
71+
resource(r_name).stage do
72+
%W[ext/#{r_name} test/#{r_name}].each { |stem| (buildpath/stem).rmtree }
73+
(buildpath/"ext").install "ext/#{r_name}"
74+
Pathname.new("lib").each_child do |child|
75+
if child.directory?
76+
child.each_child { |grandchild| (buildpath/"ext"/r_name/child).install grandchild }
77+
next
78+
end
79+
80+
(buildpath/"ext"/r_name/"lib").install child
81+
end
82+
(buildpath/"ext"/r_name).install "#{r_name}.gemspec"
83+
(buildpath/"test").install "test/#{r_name}"
84+
end
85+
end
86+
87+
paths = %w[libyaml openssl@3 readline].map { |f| Formula[f].opt_prefix }
5888
args = %W[
5989
--prefix=#{prefix}
6090
--enable-shared

0 commit comments

Comments
 (0)