-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from Homebrew/3.3.1
Portable Ruby 3.3.1
- Loading branch information
Showing
3 changed files
with
3 additions
and
132 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,29 +3,25 @@ | |
class PortableRuby < PortableFormula | ||
desc "Powerful, clean, object-oriented scripting language" | ||
homepage "https://www.ruby-lang.org/" | ||
url "https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.4.tar.gz" | ||
sha256 "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6" | ||
url "https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.1.tar.gz" | ||
sha256 "8dc2af2802cc700cd182d5430726388ccf885b3f0a14fcd6a0f21ff249c9aa99" | ||
license "Ruby" | ||
|
||
depends_on "pkg-config" => :build | ||
depends_on "portable-libyaml" => :build | ||
depends_on "portable-openssl" => :build | ||
|
||
on_linux do | ||
depends_on "portable-libedit" => :build | ||
depends_on "portable-libffi" => :build | ||
depends_on "portable-libxcrypt" => :build | ||
depends_on "portable-ncurses" => :build | ||
depends_on "portable-zlib" => :build | ||
end | ||
|
||
def install | ||
libyaml = Formula["portable-libyaml"] | ||
libxcrypt = Formula["portable-libxcrypt"] | ||
openssl = Formula["portable-openssl"] | ||
libedit = Formula["portable-libedit"] | ||
libffi = Formula["portable-libffi"] | ||
ncurses = Formula["portable-ncurses"] | ||
zlib = Formula["portable-zlib"] | ||
|
||
args = portable_configure_args + %W[ | ||
|
@@ -34,15 +30,11 @@ def install | |
--with-static-linked-ext | ||
--with-out-ext=win32,win32ole | ||
--without-gmp | ||
--enable-libedit | ||
--disable-install-doc | ||
--disable-install-rdoc | ||
--disable-dependency-tracking | ||
] | ||
|
||
# Correct MJIT_CC to not use superenv shim | ||
args << "MJIT_CC=/usr/bin/#{DevelopmentTools.default_compiler}" | ||
|
||
# We don't specify OpenSSL as we want it to use the pkg-config, which `--with-openssl-dir` will disable | ||
args += %W[ | ||
--with-libyaml-dir=#{libyaml.opt_prefix} | ||
|
@@ -52,16 +44,8 @@ def install | |
ENV["XCFLAGS"] = "-I#{libxcrypt.opt_include}" | ||
ENV["XLDFLAGS"] = "-L#{libxcrypt.opt_lib}" | ||
|
||
# We want Ruby to link to our ncurses, instead of libtermcap in CentOS 5 | ||
inreplace "ext/readline/extconf.rb" do |s| | ||
s.gsub! "dir_config('termcap')", "" | ||
s.gsub! 'have_library("termcap", "tgetnum") ||', "" | ||
end | ||
|
||
args += %W[ | ||
--with-libedit-dir=#{libedit.opt_prefix} | ||
--with-libffi-dir=#{libffi.opt_prefix} | ||
--with-ncurses-dir=#{ncurses.opt_prefix} | ||
--with-zlib-dir=#{zlib.opt_prefix} | ||
] | ||
|
||
|
@@ -109,8 +93,6 @@ def install | |
# C++ compiler might have been disabled because we break it with [email protected] builds | ||
s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') | ||
end | ||
|
||
cp_r ncurses.share/"terminfo", share/"terminfo" | ||
end | ||
|
||
libexec.mkpath | ||
|
@@ -130,7 +112,7 @@ def install | |
assert_equal ruby.to_s, shell_output("#{ruby} -e 'puts RbConfig.ruby'").chomp | ||
assert_equal "3632233996", | ||
shell_output("#{ruby} -rzlib -e 'puts Zlib.crc32(\"test\")'").chomp | ||
assert_equal " \t\n\"\\'`@$><=;|&{(", | ||
assert_equal " \t\n`><=;|&{(", | ||
shell_output("#{ruby} -rreadline -e 'puts Readline.basic_word_break_characters'").chomp | ||
assert_equal '{"a"=>"b"}', | ||
shell_output("#{ruby} -ryaml -e 'puts YAML.load(\"a: b\")'").chomp | ||
|