aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorSamuel John2013-08-12 15:15:12 +0200
committerSamuel John2013-08-12 15:18:14 +0200
commita6da4f056c63d12699f97503fb09321fdeddc02c (patch)
treea3051050ad6cc2794172f12e013a830f3f8ece9c /Library/Formula
parent2cb90690ffb7a1e11904496bfc523fdf2586e8a3 (diff)
downloadhomebrew-a6da4f056c63d12699f97503fb09321fdeddc02c.tar.bz2
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
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/vim.rb39
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