Created
June 8, 2011 15:24
-
-
Save tejo/1014634 to your computer and use it in GitHub Desktop.
vim formula with ruby support for brew
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
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' | |
version '7.3.135' | |
def patchlevel; 135 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| | |
if ARGV.include? "--#{i}" | |
opts << "--enable-#{i}interp=yes" | |
opts << "--with-lua-prefix=/usr/local" if i == "lua" | |
end | |
end | |
system "./configure", | |
"--enable-rubyinterp", | |
"--disable-gui", | |
"--without-x", | |
"--disable-gpm", | |
"--disable-nls", | |
"--with-tlib=ncurses", | |
"--enable-multibyte", | |
"--with-features=#{feature}", | |
"--prefix=#{prefix}", | |
"--mandir=#{man}", | |
*opts | |
system "make install" | |
end | |
# Suppress brew-audit. Silly, but it works. | |
# ARGV.include? "--tiny"; ARGV.include? "--small" | |
# ARGV.include? "--normal" | |
# ARGV.include? "--big"; ARGV.include? "--huge" | |
# ARGV.include? "--lua"; ARGV.include? "--mzscheme" | |
# ARGV.include? "--tcl"; ARGV.include? "--ruby" | |
# ARGV.include? "--perl"; ARGV.include? "--python" | |
# ARGV.include? "--python3" | |
# | |
# Maybe we should deprecate these options and add | |
# `--with-features=' and `--enable-interp='. | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
brew install gist_url