Skip to content

Commit

Permalink
ruby 2.0.0-p0
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#18054.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information
sferik authored and jacknagel committed Feb 27, 2013
1 parent b3b766b commit 2a48039
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Formula/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

class Ruby < Formula
homepage 'http://www.ruby-lang.org/en/'
url 'http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.bz2'
sha256 '5a7334dfdf62966879bf539b8a9f0b889df6f3b3824fb52a9303c3c3d3a58391'
url 'http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.bz2'
sha256 'c680d392ccc4901c32067576f5b474ee186def2fcd3fcbfa485739168093295f'

head 'http://svn.ruby-lang.org/repos/ruby/trunk/'

env :std

option :universal
option 'with-suffix', 'Suffix commands with "19"'
option 'with-suffix', 'Suffix commands with "20"'
option 'with-doc', 'Install documentation'
option 'with-tcltk', 'Install with Tcl/Tk support'

Expand All @@ -24,6 +24,7 @@ class Ruby < Formula
depends_on 'readline'
depends_on 'gdbm'
depends_on 'libyaml'
depends_on 'openssl' if MacOS.version >= :mountain_lion
depends_on :x11 if build.include? 'with-tcltk'

fails_with :llvm do
Expand All @@ -36,11 +37,20 @@ def install
args = ["--prefix=#{prefix}",
"--enable-shared"]

args << "--program-suffix=19" if build.include? "with-suffix"
args << "--program-suffix=20" if build.include? "with-suffix"
args << "--with-arch=x86_64,i386" if build.universal?
args << "--disable-tcltk-framework" << "--with-out-ext=tcl" << "--with-out-ext=tk" unless build.include? "with-tcltk"
args << "--disable-install-doc" unless build.include? "with-doc"

# OpenSSL is deprecated on OS X 10.8 and Ruby can't find the outdated
# version (0.9.8r 8 Feb 2011) that ships with the system.
# See discussion https://github.com/sstephenson/ruby-build/issues/304
# and https://github.com/mxcl/homebrew/pull/18054
if MacOS.version >= :mountain_lion
openssl = Formula.factory('openssl')
args << "--with-openssl-dir=#{openssl.opt_prefix}"
end

# Put gem, site and vendor folders in the HOMEBREW_PREFIX
ruby_lib = HOMEBREW_PREFIX/"lib/ruby"
(ruby_lib/'site_ruby').mkpath
Expand All @@ -55,7 +65,6 @@ def install
system "make"
system "make install"
system "make install-doc" if build.include? "with-doc"

end

def caveats; <<-EOS.undent
Expand Down

0 comments on commit 2a48039

Please sign in to comment.