2009-12-26 14:11:03 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Macvim < Formula
|
2011-02-18 05:00:59 +00:00
|
|
|
url 'https://github.com/b4winckler/macvim/tarball/snapshot-57'
|
|
|
|
version '7.3-57'
|
|
|
|
md5 '2bf4630be2d59f62b8b70870ba1fe0a1'
|
2010-10-06 16:48:58 +00:00
|
|
|
head 'git://github.com/b4winckler/macvim.git', :branch => 'master'
|
2010-08-21 18:49:25 +00:00
|
|
|
homepage 'http://code.google.com/p/macvim/'
|
2009-12-26 14:11:03 +00:00
|
|
|
|
2010-08-14 21:00:47 +00:00
|
|
|
def options
|
2010-12-09 22:57:44 +00:00
|
|
|
[
|
|
|
|
# Building custom icons fails for many users, so off by default.
|
|
|
|
["--custom-icons", "Try to generate custom document icons."],
|
2010-12-29 21:03:13 +00:00
|
|
|
["--with-cscope", "Build with Cscope support."],
|
2011-02-02 12:34:59 +00:00
|
|
|
["--with-envycoder", "Build with Envy Code R Bold font."],
|
|
|
|
["--override-system-vim", "Override system vim"]
|
2010-12-09 22:57:44 +00:00
|
|
|
]
|
2010-08-14 21:00:47 +00:00
|
|
|
end
|
|
|
|
|
2010-11-26 19:20:24 +00:00
|
|
|
depends_on 'cscope' if ARGV.include? '--with-cscope'
|
|
|
|
|
2009-12-26 14:11:03 +00:00
|
|
|
def install
|
2010-04-07 05:58:35 +00:00
|
|
|
# MacVim's Xcode project gets confused by $CC
|
|
|
|
# Disable it until someone figures out why it fails.
|
2009-12-26 14:11:03 +00:00
|
|
|
ENV['CC'] = nil
|
|
|
|
ENV['CFLAGS'] = nil
|
|
|
|
ENV['CXX'] = nil
|
|
|
|
ENV['CXXFLAGS'] = nil
|
|
|
|
|
2011-03-13 18:27:30 +00:00
|
|
|
arch = Hardware.is_64_bit? ? 'x86_64' : 'i386'
|
|
|
|
ENV['ARCHFLAGS'] = "-arch #{arch}"
|
|
|
|
|
2010-11-26 19:20:24 +00:00
|
|
|
args = ["--with-macsdk=#{MACOS_VERSION}",
|
2009-12-26 14:11:03 +00:00
|
|
|
# Add some features
|
|
|
|
"--with-features=huge",
|
2011-03-13 18:27:30 +00:00
|
|
|
"--with-macarchs=#{arch}",
|
2009-12-26 14:11:03 +00:00
|
|
|
"--enable-perlinterp",
|
|
|
|
"--enable-pythoninterp",
|
|
|
|
"--enable-rubyinterp",
|
2010-11-26 19:20:24 +00:00
|
|
|
"--enable-tclinterp"]
|
|
|
|
|
|
|
|
if ARGV.include? "--with-cscope"
|
|
|
|
args << "--enable-cscope"
|
|
|
|
end
|
|
|
|
|
|
|
|
system "./configure", *args
|
2010-08-14 21:00:47 +00:00
|
|
|
|
2010-12-09 22:57:44 +00:00
|
|
|
unless ARGV.include? "--custom-icons"
|
2010-08-14 21:00:47 +00:00
|
|
|
inreplace "src/MacVim/icons/Makefile", "$(MAKE) -C makeicns", ""
|
|
|
|
inreplace "src/MacVim/icons/make_icons.py", "dont_create = False", "dont_create = True"
|
|
|
|
end
|
|
|
|
|
2010-12-29 21:03:13 +00:00
|
|
|
unless ARGV.include? "--with-envycoder"
|
|
|
|
inreplace "src/MacVim/icons/Makefile", '$(OUTDIR)/MacVim-generic.icns: make_icons.py vim-noshadow-512.png loadfont.so Envy\ Code\ R\ Bold.ttf',
|
|
|
|
"$(OUTDIR)/MacVim-generic.icns: make_icons.py vim-noshadow-512.png loadfont.so"
|
|
|
|
end
|
|
|
|
|
2009-12-26 14:11:03 +00:00
|
|
|
system "make"
|
|
|
|
|
|
|
|
prefix.install "src/MacVim/build/Release/MacVim.app"
|
|
|
|
inreplace "src/MacVim/mvim", /^# VIM_APP_DIR=\/Applications$/,
|
|
|
|
"VIM_APP_DIR=#{prefix}"
|
|
|
|
bin.install "src/MacVim/mvim"
|
|
|
|
|
|
|
|
# Create MacVim vimdiff, view, ex equivalents
|
2011-02-02 12:34:59 +00:00
|
|
|
executables = %w[mvimdiff mview mvimex]
|
|
|
|
executables << "vim" if ARGV.include? "--override-system-vim"
|
|
|
|
executables.each {|f| ln_s bin+'mvim', bin+f}
|
2009-12-26 14:11:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
2010-11-07 05:10:49 +00:00
|
|
|
"MacVim.app installed to:\n#{prefix}"
|
2009-12-26 14:11:03 +00:00
|
|
|
end
|
|
|
|
end
|