aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/vim.rb26
1 files changed, 23 insertions, 3 deletions
diff --git a/Library/Formula/vim.rb b/Library/Formula/vim.rb
index 348e9d8f4..7f319c5dd 100644
--- a/Library/Formula/vim.rb
+++ b/Library/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,