-
-
Save sirupsen/1110471 to your computer and use it in GitHub Desktop.
Script to install Vim 7.3 with ruby support for Mac OS X Lion
This file contains 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
# requires root permissions in /usr/bin/ | |
star = String.new | |
8.times { star += "*" } | |
Star = "\n#{star * 3}\n" | |
def newblock string | |
puts "\n#{Star}#{string}#{Star}\n" | |
end | |
newblock "compiling with system ruby" | |
system 'rvm system' | |
newblock " move to /tmp/" | |
Dir.chdir("/tmp\/") | |
pwd = Dir.pwd | |
newblock "curl & expand vim73 source" | |
system 'curl ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 | tar -xz' | |
Dir.chdir"#{pwd}/vim73/" | |
newblock = "Start configure" | |
system "./configure" | |
newblock "Start options configuration" | |
# Will complain about xterm and clipboard - but they're enabled so... | |
system "./configure --with-features=huge --enable-cscope --enable-pythoninterp --enable-rubyinterp --enable-perlinterp --enable-gui=macvim --enable-multibyte --enable-clipboard=yes --enable-xterm_clipboard=yes" | |
newblock "Set arch in LDFlags" | |
arch = "-arch x86_64" | |
config = File.read("#{Dir.pwd}/src/auto/config.mk") | |
r = config.gsub(/.*LDFLAGS.*/,"LDFLAGS = -L. #{arch} -L/usr/local/lib") | |
File.open("#{Dir.pwd}/src/auto/config.mk", "w") { |file| file.puts r } | |
newblock "Make" | |
system "make" | |
newblock "new vim is in /tmp/vim73/src/vim. please verify by typing /tmp/vim73/src/vim --version\n | |
you may symlink it to /usr/bin if you'd like. 'sudo make install' will install to /usr/local/share/" | |
newblock "sudo Make" | |
system "sudo make install" | |
newblock "old vim symlink moved to /usr/bin/vim.old" | |
system "sudo mv /usr/bin/vim /usr/bin/vim.old" | |
system "sudo ln -s /usr/local/bin/vim /usr/bin/vim" |
This can't work. rvm system
is unavailable as rvm
is not loaded in current session as a function but remains as a binary. So rvm system
do not switch to the good ruby version. I tried some things like:
newblock "Ensure that the right version of Ruby (1.8.7) is set"
if system('which rvm')
if File.exists? ENV['HOME'] +"/.rvm/scripts/rvm"
newblock "Load RVM into session *as a function*"
`source "#{ENV['HOME'] +"/.rvm/scripts/rvm"}"`
elsif File.exists?
newblock "Load RVM into session *as a function* from a root install"
`source "/usr/local/rvm/scripts/rvm"`
else
puts "ERROR: No RVM installation found.\n"
exit
end
`rvm use system`
end
But it doesn't work neither. I don't know what to do. Shell script?
Laughing at my self on the post above. This script works like a charm on a virgin install of 10.7 Lion. Shout out to my Code-brother, you know who you are.
Spit out Error 1 and Error 2 towards the end but seemed to work overall...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does not work for me on Lion, install libiconv, still does not work
UPDATE : I wanted to recompile vim to get command-t to work. In the end I did the following :
Install MacVim with homebrew
alias vim='mvim -v' in .bash_profile to get macvim to open like vim in a terminal.
cd ~/.vim/bundle/command-t/ruby/command-t
make clean
env ARCHFLAGS="-arch x86_64" ruby extconf.rb
env ARCHFLAGS="-arch x86_64" make