aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Hoelz2012-10-30 16:50:46 +0100
committerJack Nagel2012-11-19 21:48:02 -0600
commitf086fc9b32ee17287d81220e69f5febbbe04041b (patch)
tree290cb8552042b6e0bc16de5ec3d5b16f8f736ee3
parenta2d240aecc107719f264f4dea72476f8c543dc12 (diff)
downloadhomebrew-f086fc9b32ee17287d81220e69f5febbbe04041b.tar.bz2
vim: options for enabling and disabling language support
Closes #15757. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-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,