From a6da4f056c63d12699f97503fb09321fdeddc02c Mon Sep 17 00:00:00 2001 From: Samuel John Date: Mon, 12 Aug 2013 15:15:12 +0200 Subject: vim: Build with system python on Xcode-only Macs Also end the crazy loads of options. Note, that if both `--with-foo` and `--without-foo` are defined as options, then `build.with? 'foo'` does not work as expected for `:recommended` options. Fixes #21825 --- Library/Formula/vim.rb | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'Library/Formula/vim.rb') 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 -- cgit v1.2.3