Skip to content

Commit

Permalink
Merge pull request #190 from Homebrew/3.3.1
Browse files Browse the repository at this point in the history
Portable Ruby 3.3.1
  • Loading branch information
MikeMcQuaid authored May 16, 2024
2 parents 786adbf + cf7a8b8 commit 9c76001
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 132 deletions.
36 changes: 0 additions & 36 deletions Formula/portable-libedit.rb

This file was deleted.

75 changes: 0 additions & 75 deletions Formula/portable-ncurses.rb

This file was deleted.

24 changes: 3 additions & 21 deletions Formula/portable-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand All @@ -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}
Expand All @@ -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}
]

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9c76001

Please sign in to comment.