From 087645a4ecf190946ba33e532d6bd6a97bbbb8e0 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Fri, 11 May 2012 10:57:51 +1000 Subject: MacVim: warn if not using Ruby 1.8.x Fixes #12199. --- Library/Formula/macvim.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Library/Formula/macvim.rb') diff --git a/Library/Formula/macvim.rb b/Library/Formula/macvim.rb index 42ef95951..fb095a2c5 100644 --- a/Library/Formula/macvim.rb +++ b/Library/Formula/macvim.rb @@ -1,5 +1,20 @@ require 'formula' +class Ruby18x < Requirement + def message; <<-EOS.undent + MacVim compiles against whatever Ruby it finds in your path, and has + problems working with Ruby 1.9. We've detected Ruby 1.9 in your path, + so this compile may fail. + EOS + end + def fatal? + false + end + def satisfied? + `ruby --version` =~ /1\.8\.\d/ + end +end + class Macvim < Formula homepage 'http://code.google.com/p/macvim/' url 'https://github.com/b4winckler/macvim/tarball/snapshot-64' @@ -17,6 +32,7 @@ class Macvim < Formula ] end + depends_on Ruby18x.new depends_on 'cscope' if ARGV.include? '--with-cscope' depends_on 'lua' if ARGV.include? '--with-lua' @@ -33,6 +49,10 @@ class Macvim < Formula arch = MacOS.prefer_64_bit? ? 'x86_64' : 'i386' ENV['ARCHFLAGS'] = "-arch #{arch}" + if `ruby --version` =~ /1\.9\.\d/ + opoo "Your default ruby is 1.9.x, install will likely fail. Try using system ruby" + end + args = ["--with-features=huge", "--with-tlib=ncurses", "--enable-multibyte", -- cgit v1.2.3