43 lines
1.4 KiB
Ruby
43 lines
1.4 KiB
Ruby
class RubyBuild < Formula
|
|
desc "Install various Ruby versions and implementations"
|
|
homepage "https://github.com/rbenv/ruby-build"
|
|
url "https://github.com/rbenv/ruby-build/archive/v20210510.tar.gz"
|
|
sha256 "529fcf9eb4d4e857c7394787000aedc1da830cf9d86fe9f808581d35c37b032e"
|
|
license "MIT"
|
|
head "https://github.com/rbenv/ruby-build.git"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "92c2ec2f10038f644c8d8c0adcc123170d384f72951570724f0b2cd2c380164c"
|
|
end
|
|
|
|
depends_on "autoconf"
|
|
depends_on "pkg-config"
|
|
depends_on "readline"
|
|
|
|
def install
|
|
# these references are (as-of v20210420) only relevant on FreeBSD but they
|
|
# prevent having identical bottles between platforms so let's fix that.
|
|
inreplace "bin/ruby-build", "/usr/local", HOMEBREW_PREFIX
|
|
|
|
ENV["PREFIX"] = prefix
|
|
system "./install.sh"
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
ruby-build installs a non-Homebrew OpenSSL for each Ruby version installed and these are never upgraded.
|
|
|
|
To link Rubies to Homebrew's OpenSSL 1.1 (which is upgraded) add the following
|
|
to your #{shell_profile}:
|
|
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
|
|
|
|
Note: this may interfere with building old versions of Ruby (e.g <2.4) that use
|
|
OpenSSL <1.1.
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
assert_match "2.0.0", shell_output("#{bin}/ruby-build --definitions")
|
|
end
|
|
end
|