From d727f8b7f34d6d355bf64233cf49287012f457bc Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sat, 19 May 2012 19:57:56 -0500 Subject: Replace /usr/bin/ruby with full Framework path Rationale: some users insist on replacing the /usr/bin/ruby symlink to point to another ruby on their system, which may break homebrew. Use the full Framework path instead, which is less likely to be tampered with. This also reorganizes the brew --config checks to reflect the different path. Fixes #12009. Closes #12333. Signed-off-by: Misty De Meo --- Library/Formula/rrdtool.rb | 5 +++-- Library/Formula/rubinius.rb | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/rrdtool.rb b/Library/Formula/rrdtool.rb index 9a02ee556..ece3c4cb3 100644 --- a/Library/Formula/rrdtool.rb +++ b/Library/Formula/rrdtool.rb @@ -28,13 +28,14 @@ class Rrdtool < Formula which_perl = which 'perl' which_ruby = which 'ruby' + ruby_path = "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby" - opoo "Using system Ruby. RRD module will be installed to /Library/Ruby/..." if which_ruby == "/usr/bin/ruby" + opoo "Using system Ruby. RRD module will be installed to /Library/Ruby/..." if which_ruby.realpath == ruby_path opoo "Using system Perl. RRD module will be installed to /Library/Perl/..." if which_perl == "/usr/bin/perl" args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--mandir=#{man}"] args << "--enable-perl-site-install" if which_perl == "/usr/bin/perl" - args << "--enable-ruby-site-install" if which_ruby == "/usr/bin/ruby" + args << "--enable-ruby-site-install" if which_ruby.realpath == ruby_path system "./configure", *args diff --git a/Library/Formula/rubinius.rb b/Library/Formula/rubinius.rb index 1310364d5..0cc1894f5 100644 --- a/Library/Formula/rubinius.rb +++ b/Library/Formula/rubinius.rb @@ -20,18 +20,20 @@ class Rubinius < Formula # Set to stop Rubinius messing with our prefix. ENV["RELEASE"] = "1" - system "/usr/bin/ruby", "./configure", - "--skip-system", # download and use the prebuilt LLVM - "--bindir", bin, - "--prefix", prefix, - "--includedir", "#{include}/rubinius", - "--libdir", lib, - "--mandir", man, # For completeness; no manpages exist yet. - "--gemsdir", "#{lib}/rubinius/gems" + ruby = "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby" + + system ruby, "./configure", + "--skip-system", # download and use the prebuilt LLVM + "--bindir", bin, + "--prefix", prefix, + "--includedir", "#{include}/rubinius", + "--libdir", lib, + "--mandir", man, # For completeness; no manpages exist yet. + "--gemsdir", "#{lib}/rubinius/gems" ohai "config.rb", File.open('config.rb').to_a if ARGV.debug? or ARGV.verbose? - system "/usr/bin/ruby", "-S", "rake", "install" + system ruby, "-S", "rake", "install" # Remove conflicting command aliases bin.children.select(&:symlink?).each(&:unlink) -- cgit v1.2.3