vim: options for enabling and disabling language support

Closes Homebrew/homebrew#15757.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Rob Hoelz 2012-10-30 16:50:46 +01:00 committed by Jack Nagel
parent 142288863b
commit cbb763b760

View file

@ -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,