-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_vim_debian.sh
executable file
·103 lines (91 loc) · 2.98 KB
/
install_vim_debian.sh
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
#!/usr/bin/env bash
#==============================================================================
# GVim compile and install script for Debian
#
# Description: Install VIM with +python/+python3 via pyenv installed pythons
# Author: Alisue <[email protected]>
# License: MIT
#==============================================================================
# Install required packages
echo "Install required packages..."
# fundemental requirements
sudo apt-get install -y -q \
build-essential wget curl checkinstall
# vim requirements
sudo apt-get install -y -q \
libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk-4-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev \
liblua5.2-dev lua5.2 ruby-dev ruby
# pyenv requirements (to compile Python)
sudo apt-get install -y -q \
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm
if [[ $(which pyenv >/dev/null 2>&1) ]]; then
echo "'pyenv' chould not be found. This script use python and python3"
echo "installed via 'pyenv' thus install it first as:"
echo
echo "> curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash"
echo
exit 1
fi
# Find out latest stable version
LATEST2=$(pyenv install -l | grep -E "^ 2\.[0-9]+\.[0-9]+$" | tail -1 | sed -re 's/^\s+//')
LATEST3=$(pyenv install -l | grep -E "^ 3\.[0-9]+\.[0-9]+$" | tail -1 | sed -re 's/^\s+//')
# Install Python 2 and Python 3
echo "Install Python $LATEST2 and $LATEST3. It takes minutes so be patient..."
env PYTHON_CONFIGURE_OPTS="--enable-shared --enable-unicode=ucs4" pyenv install $LATEST2
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install $LATEST3
echo "Downloading VIM..."
if [[ ! -d vim ]]; then
git clone https://github.com/vim/vim
cd vim
else
cd vim
git reset --hard
sudo git clean -fd
git pull
fi
echo "Configure & compiling VIM..."
pyenv deactivate
# Activate 2.7 and 3.4
pyenv local $LATEST2 $LATEST3
sudo make distclean
./configure \
--enable-fail-if-missing \
--with-features=huge \
--enable-pythoninterp=dynamic \
--enable-python3interp=dynamic \
--enable-rubyinterp \
--enable-multibyte \
--enable-fontset \
--enable-gui=gtk4 \
--enable-cscope
if [[ $? ]]; then
make
echo "Installing Vim..."
sudo checkinstall
#add python libraries to ld.so.conf.d
sudo tee -a /etc/ld.so.conf.d/usrlib.conf << EOF
$PYENV_ROOT/versions/$LATEST2/lib
$PYENV_ROOT/versions/$LATEST3/lib
EOF
sudo ldconfig -v
#if [ ! -d "${HOME}/.local/share/applications" ]; then
# mkdir -p "${HOME}/.local/share/applications"
#fi
#
#cat <<EOF > ${HOME}/.local/share/applications/gvim.desktop
##!/usr/bin/env xdg-open
#[Desktop Entry]
#Name=GVim
#Version=7.4
#GenericName=Editor
#Comment=Graphical version of Vim
#Terminal=false
#Icon=gvim
#Type=Application
#Exec=gvim %U
#TryExec=gvim
#Categories=Programming; System Utilities
#EOF
fi