Last active
February 26, 2021 10:27
-
-
Save lambdalisue/102a1f9985b243cd0e71 to your computer and use it in GitHub Desktop.
An install script of GVim (+python/+python3) in Ubuntu/Debian
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
#!/bin/bash | |
#============================================================================== | |
# An install script of GVim in Ubuntu/Debian | |
#============================================================================== | |
echo "Installing required packages ..." | |
sudo apt-get install -yq build-essential curl | |
sudo apt-get install -yq \ | |
libncurses5-dev \ | |
libbonoboui2-dev \ | |
libcario2-dev libxpm-dev \ | |
libx11-dev libxt-dev \ | |
libgnome2-dev libgnomeui-dev \ | |
libgtk2.0-dev libatk1.0-dev | |
sudo apt-get install -yq \ | |
lua5.2 liblua5.2-dev \ | |
luajit libluajit-5.1 | |
sudo apt-get install -yq \ | |
libssl-dev zlib1g-dev libbz2-dev \ | |
libreadline-dev libsqlite3-dev llvm | |
PYTHON2=$(pyenv install -l | \ | |
grep -E "^ 2\.[0-9]+\.[0-9]+$" | \ | |
tail -1 | sed -e 's/^[ ]*//') | |
PYTHON3=$(pyenv install -l | \ | |
grep -E "^ 3\.[0-9]+\.[0-9]+$" | \ | |
tail -1 | sed -e 's/^[ ]*//') | |
echo "Installing Python $PYTHON2 and $PYTHON3 ..." | |
CONFIGURE_OPTS="--enable-shared --enable-unicode-ucs4" \ | |
pyenv install $PYTHON2 | |
CONFIGURE_OPTS="--enable-shared" \ | |
pyenv install $PYTHON3 | |
echo "Downloading Vim repository ..." | |
if [[ -d vim ]]; then | |
rm -rf vim | |
fi | |
git clone --depth=1 https://github.com/vim/vim | |
cd vim | |
pyenv local ${PYTHON2} ${PYTHON3} | |
echo "Configure Vim installation ..." | |
make distclean | |
#./configure \ | |
PREFIX="${HOME}/.anyenv/envs/pyenv/versions" | |
LDFLAGS="-Wl,-rpath=${PREFIX}/${PYTHON2}/lib:${PREFIX}/${PYTHON3}/lib" ./configure \ | |
--enable-fail-if-missing \ | |
--with-features=huge \ | |
--with-luajit \ | |
--enable-luainterp \ | |
--enable-pythoninterp=dynamic \ | |
--enable-python3interp=dynamic \ | |
--enable-multibyte \ | |
--enable-fontset \ | |
--enable-gui=gnome2 | tee ../install_gvim.configure.log | |
echo | |
echo "Confirm 'install_gvim.configure.log' if the following lines are correct" | |
echo | |
echo " checking whether we can do without RTLD_GLOBAL for Python... yes" | |
echo " checking whether we can do without RTLD_GLOBAL for Python3... yes" | |
echo | |
echo "Otherwise you cannot switch python and python3 in a same Vim session." | |
echo "Then execute the following:" | |
echo | |
echo " make -j 12" | |
echo " sudo porg -lD 'make install'" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry I haven't notice your comment.
pyenv
is used to build Python 2 and Python 3 with--enable-shared
while Vim on Debian package was not compiled with that parameter.And the command is https://github.com/yyuu/pyenv