-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.rb
77 lines (62 loc) · 2.04 KB
/
install.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/ruby
require 'rubygems'
require 'net/ftp'
require 'ruby-debug'
require 'fileutils'
include FileUtils
puts '*** getting all patches'
rm_rf 'patches'
mkdir 'patches'
cd 'patches'
Net::FTP.open('ftp.vim.org') do |ftp|
ftp.login
files = ftp.chdir('pub/vim/patches/7.2')
files = ftp.list('*')
files.each do |file|
puts "getting #{file.split.last}" if file.split.last.scan(/7\.2\.\d{3}$/)[0]
ftp.get(file.split.last) if file.split.last.scan(/7\.2\.\d{3}$/)[0]
end
end
cd '../'
puts '*** finished getting patches'
Net::FTP.open('ftp.vim.org') do |ftp|
ftp.login
files = ftp.chdir('pub/vim/unix')
files = ftp.list('')
puts '*** getting the vim source'
ftp.get('vim-7.2.tar.bz2')
end
puts '*** extracting the vim source'
system 'tar xvzf vim-7.2.tar.bz2 2>&1'
puts '*** removing downloaded tarball'
rm 'vim-7.2.tar.bz2'
puts '*** applying patches'
cd 'vim72'
files = Dir['../patches/7.2.*']
files.each do |file|
system "patch -t -p0 < #{file} >&1 |tee >> patch.log"
end
puts '*** updating vim runtime files'
system 'rsync -avzcP --delete --exclude="/dos/" ftp.nluug.nl::Vim/runtime/ ./runtime/ 2>&1 |tee rsync.log'
#makefile = File.open('src/Makefile', 'r+')
# just want to include ruby for now
#makefile.each_line do |line|
# puts makefile.write line.gsub('#','') if line =~ /--enable-rubyinterp$/
#end.close
system(<<-CONFIG)
./configure --with-features=huge \
--enable-rubyinterp \
--enable-pythoninterp \
2>&1 |tee configure.log
CONFIG
system 'make 2>&1 |tee make.log'
puts <<-THEEND
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
That's all for me. Next check out the compiled version with:
vim72/src/vim --version
and you should see that all patches were applied.
Next copy vim, vimtutor, and any other binaries you want to
keep from this deeply moving experience to a directory in your
path, and have fun with some vanilla vim!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
THEEND