Created
July 18, 2014 16:54
-
-
Save usergenic/e1ca55ed9239989af471 to your computer and use it in GitHub Desktop.
Homebrew Recipe for Vim w/ Lua, Ruby, Python interp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified from old Mike Grouchy blog post: | |
# http://mikegrouchy.com/blog/2012/05/compile-vim-with-python-support-on-osx-with-homebrew.html | |
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
url 'https://vim.googlecode.com/hg/'#, :revision => '6c318419e331' | |
version '7.4.373' #version '7.3.515' | |
def features; %w(tiny small normal big huge) end | |
def interp; %w(lua mzscheme perl python python3 tcl ruby) end | |
def options | |
[ | |
["--with-features=TYPE", "tiny, small, normal, big or huge (default: normal)"], | |
["--enable-interp=NAME,...", "lua, mzscheme, perl, python, python3, tcl and/or ruby (default:python,ruby)"] | |
] | |
end | |
def install | |
def opt_val(opt) | |
opt.sub(/.*?=(.*)$/, "\\1") rescue nil | |
end | |
opts = [] | |
feature = opt_val(ARGV.find {|s| s =~ /^--with-features=/ }) || "normal" | |
# For compatibility and convenience {{{ | |
feature_shorthand = features.find {|f| ARGV.include? "--#{f}" } | |
feature = feature_shorthand if feature_shorthand | |
# }}} | |
opts << "--with-features=#{feature}" | |
interps = opt_val(ARGV.find {|s| s =~ /^--enable-interp=/ }) || "python,ruby,lua" | |
interps = interps.split(/,/) | |
# For compatibility and convenience {{{ | |
interp.each do |i| | |
if ARGV.include? "--#{i}" | |
interps << i | |
end | |
end | |
# }}} | |
interps.uniq! | |
interps.each do |i| | |
opts << "--enable-#{i}interp=yes" | |
opts << "--with-lua-prefix=/usr/local" if i == "lua" | |
end | |
system "./configure", | |
"--disable-gui", | |
"--without-x", | |
"--disable-nls", | |
"--disable-gpm", | |
"--disable-netbeans", | |
"--disable-arabic", | |
"--disable-farsi", | |
"--disable-cscope", | |
"--disable-emacs_tags", | |
"--disable-keymap", | |
"--disable-langmap", | |
"--enable-feature=browse", | |
"--with-tlib=ncurses", | |
"--enable-multibyte", | |
"--prefix=#{prefix}", | |
"--mandir=#{man}", | |
*opts | |
system "make install" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment