-
Notifications
You must be signed in to change notification settings - Fork 5
/
rebuild-vim
executable file
·109 lines (102 loc) · 2.71 KB
/
rebuild-vim
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
set -eu
ruby=yes
pull=no
clean=no
builddeps=no
for arg; do
case "$arg" in
-h|--help)
echo "Usage: $0 [options]"
echo "Options:"
echo " --pull git pull before building"
echo " --clean git clean -dfx before building"
echo " --build-deps sudo apt install build dependencies"
echo " --no-ruby disable :ruby support"
exit
;;
--no-ruby)
ruby=no
;;
--clean)
clean=yes
;;
--pull)
pull=yes
;;
--build-deps)
builddeps=yes
;;
*)
echo "unrecognized argument: $arg" 1>&2
exit 1
;;
esac
done
COMPILED_BY="Marius Gedminas <marius@gedmin.as>"
FEATURES=(
"--with-features=huge" # yum, features
"--enable-multibyte" # vim is *crippled* without this!
# (BTW 'big' implies this)
"--enable-python3interp" # most of my plugins use this
"--enable-gpm" # heh retro
"--enable-terminal" # fancy!
# "--enable-perlinterp" # ruby + perl = segfault
"--enable-luainterp" # vim-flog v2 needs this?
"--with-luajit" # vim-flog v2 needs Lua 5.1 or LuaJIT 2.1
# taken from ubuntu's debian/rules
"--with-x"
"--enable-xim"
"--enable-gui=gtk3"
"--disable-gtk2-check"
"--enable-gnome-check"
"--disable-motif-check"
"--disable-athena-check"
"--disable-fontset"
"--enable-fail-if-missing"
)
if [ $ruby = yes ]; then
FEATURES+=("--enable-rubyinterp") # Command-T wants this
else
FEATURES+=("--disable-rubyinterp")
fi
BUILDDEPS=(
# from https://salsa.debian.org/vim-team/vim/blob/debian/sid/debian/control
# (I picked a subset that looks reasonable to me)
autoconf
cscope
libacl1-dev
libgpmg1-dev
libgtk-3-dev
libselinux1-dev
libncurses-dev
libxaw7-dev
libxpm-dev
libxt-dev
python3-dev
ruby-dev
# I need LuaJIT
luajit
libluajit-5.1-dev
# I remember builds failing for lack of libssl-dev
libssl-dev
)
if [ $builddeps = yes ]; then
sudo apt install "${BUILDDEPS[@]}"
fi
autoclone ~/src/vim https://github.com/vim/vim/
cd ~/src/vim || exit 1
if [ $pull = yes ]; then
git pull
fi
rm -f src/auto/config.cache
if [ $clean = yes ]; then
git clean -dfx
fi
# let's not let vim's ./configure see ~/bin/python*
export PATH=/usr/lib/ccache:/usr/bin:/bin
export CFLAGS="-g"
if ! (./configure "${FEATURES[@]}" --with-compiledby="$COMPILED_BY" && make -j "$(nproc)"); then
echo "Consider $0 --build-deps" 1>&2
exit 1
fi