diff --git a/Formula/vim.rb b/Formula/vim.rb index 348e9d8f4d8..7f319c5dd23 100644 --- a/Formula/vim.rb +++ b/Formula/vim.rb @@ -11,7 +11,28 @@ class Vim < Formula env :std # To find interpreters + LANGUAGES = %w(lua mzscheme perl python python3 tcl ruby) + DEFAULT_LANGUAGES = %w(ruby python) + + LANGUAGES.each do |language| + option "with-#{language}", "Build vim with #{language} support" + option "without-#{language}", "Build vim without #{language} support" + end + def install + ENV['LUA_PREFIX'] = HOMEBREW_PREFIX + + language_opts = LANGUAGES.map do |language| + with_option = "with-#{language}" + without_option = "without-#{language}" + + if DEFAULT_LANGUAGES.include? language and !build.include? without_option + "--enable-#{language}interp" + elsif build.include? with_option + "--enable-#{language}interp" + end + end.compact + # Why are we specifying HOMEBREW_PREFIX as the prefix? # # To make vim look for the system vimscript files in the @@ -28,10 +49,9 @@ class Vim < Formula "--disable-nls", "--enable-multibyte", "--with-tlib=ncurses", - "--enable-pythoninterp", - "--enable-rubyinterp", "--enable-cscope", - "--with-features=huge" + "--with-features=huge", + *language_opts system "make" # Even though we specified HOMEBREW_PREFIX for configure,