Skip to content

Instantly share code, notes, and snippets.

@kga
Forked from uasi/vim.rb
Created December 14, 2010 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kga/740677 to your computer and use it in GitHub Desktop.
Save kga/740677 to your computer and use it in GitHub Desktop.
Vim formula for Homebrew
require 'formula'
class Vim <Formula
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
homepage 'http://www.vim.org/'
md5 '5b9510a17074e2b37d8bb38ae09edbf2'
def patchlevel; 81 end
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
def options
features.map {|f| ["--#{f}", "Configure with --with-feature-#{f}"] }
+ interp.map {|i| ["--#{i}", "Configure with --enable-#{i}interp"] }
end
def patches
patches = (1..patchlevel).map {|i| sprintf('ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.%03d', i) }
{:p0 => patches}
end
def install
feature = features.find {|f| ARGV.include? "--#{f}" } || "normal"
opts = []
interp.each do |i|
opts << "--enable-#{i}interp=yes" if ARGV.include? "--#{i}"
end
system "./configure",
"--disable-gui",
"--without-x",
"--disable-gpm",
"--disable-nls",
"--with-tlib=ncurses",
"--enable-multibyte",
"--with-feature-#{feature}",
"--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