diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/vim.rb | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/Library/Formula/vim.rb b/Library/Formula/vim.rb index e30055633..67ea9530d 100644 --- a/Library/Formula/vim.rb +++ b/Library/Formula/vim.rb @@ -15,14 +15,16 @@ class Vim < Formula # PATH as the user has set it right now. env :std - LANGUAGES = %w(lua mzscheme perl python tcl ruby) - DEFAULT_LANGUAGES = %w(ruby python) - option "override-system-vi", "Override system vi" option "disable-nls", "Build vim without National Language Support (translated messages, keymaps)" - LANGUAGES.each do |language| + LANGUAGES_OPTIONAL = %w(lua mzscheme perl tcl) + LANGUAGES_DEFAULT = %w(ruby python) + + LANGUAGES_OPTIONAL.each do |language| option "with-#{language}", "Build vim with #{language} support" + end + LANGUAGES_DEFAULT.each do |language| option "without-#{language}", "Build vim without #{language} support" end @@ -32,21 +34,26 @@ class Vim < Formula def install ENV['LUA_PREFIX'] = HOMEBREW_PREFIX - language_opts = LANGUAGES.map do |language| - if DEFAULT_LANGUAGES.include? language and !build.include? "without-#{language}" - "--enable-#{language}interp" - elsif build.include? "with-#{language}" - "--enable-#{language}interp" - end - end.compact + opts = [] + opts += LANGUAGES_OPTIONAL.map do |language| + "--enable-#{language}interp" if build.with? language + end + opts += LANGUAGES_DEFAULT.map do |language| + "--enable-#{language}interp" unless build.without? language + end - opts = language_opts opts << "--disable-nls" if build.include? "disable-nls" - # Avoid that vim always links System's Python even if configure tells us - # it has found a brewed Python. Verify with `otool -L`. - if python && python.brewed? - ENV.prepend 'LDFLAGS', "-F#{python.framework}" + if python + if python.brewed? + # Avoid that vim always links System's Python even if configure tells us + # it has found a brewed Python. Verify with `otool -L`. + ENV.prepend 'LDFLAGS', "-F#{python.framework}" + elsif python.from_osx? && !MacOS::CLT.installed? + # Avoid `Python.h not found` on 10.8 with Xcode-only + ENV.append 'CFLAGS', "-I#{python.incdir}", ' ' + # opts << "--with-python-config-dir=#{python.libdir}" + end end # XXX: Please do not submit a pull request that hardcodes the path |
