From 2a13b0ef23f58d4a7770807b3b8c9b03347df54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Tue, 8 Aug 2017 21:26:01 +0200 Subject: [PATCH] Clean up Vim-related dependencies (#128) * Upgrade Vundle * Extract Vim setup function --- .vim/bundle/Vundle.vim | 2 +- common/configure_fresh_system.sh | 2 ++ common/install_vim_from_sources.sh | 36 ++++++++++++++++++++++++++++++ debian/configure_fresh_system.sh | 27 ---------------------- fedora/configure_fresh_system.sh | 25 --------------------- 5 files changed, 39 insertions(+), 53 deletions(-) create mode 100644 common/install_vim_from_sources.sh diff --git a/.vim/bundle/Vundle.vim b/.vim/bundle/Vundle.vim index f6cc0623..6437ad6d 160000 --- a/.vim/bundle/Vundle.vim +++ b/.vim/bundle/Vundle.vim @@ -1 +1 @@ -Subproject commit f6cc06238d5ac888ddfc514f80392f44cb2e21ac +Subproject commit 6437ad6df4a3e6a87c5fb8bd2b8aadb277ec9c87 diff --git a/common/configure_fresh_system.sh b/common/configure_fresh_system.sh index 81e481f4..b743128d 100755 --- a/common/configure_fresh_system.sh +++ b/common/configure_fresh_system.sh @@ -84,6 +84,8 @@ fc-cache -rv $SUDO fc-cache -rv set -e +source "$DIR/common/install_vim_from_sources.sh" + if [[ -z $NORUST ]]; then #rust echo "installing rust" diff --git a/common/install_vim_from_sources.sh b/common/install_vim_from_sources.sh new file mode 100644 index 00000000..77db4243 --- /dev/null +++ b/common/install_vim_from_sources.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -e + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$DIR/../" + +# vim +if [[ -z $NO_COMPILE_VIM ]]; then + VIM_BUILD_DIR=`realpath "$DIR/../"` + echo "Vim sources location: $VIM_BUILD_DIR" + cd "$VIM_BUILD_DIR" + if [[ ! -d vim ]]; then + git clone https://github.com/vim/vim.git --recursive + else + cd vim + git pull + git submodule update --init --recursive + cd .. + fi + cd vim + set +e + sudo make uninstall + sudo make clean + ./configure --with-features=huge \ + --enable-multibyte \ + --enable-rubyinterp \ + --enable-python3interp=yes \ + --enable-pythoninterp=yes \ + --enable-luainterp \ + --enable-gui=no \ + --enable-cscope + make -j`nproc` + sudo make install + cd +fi diff --git a/debian/configure_fresh_system.sh b/debian/configure_fresh_system.sh index f2c039d1..19b9a3d7 100755 --- a/debian/configure_fresh_system.sh +++ b/debian/configure_fresh_system.sh @@ -32,33 +32,6 @@ echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat m sudo apt-get update sudo apt-get -y install mono-devel mono-complete -# vim -if [[ -z $NO_COMPILE_VIM ]]; then - VIM_BUILD_DIR=`realpath "$DIR/../../"` - cd "$VIM_BUILD_DIR" - if [[ ! -d vim ]]; then - git clone https://github.com/vim/vim.git --recursive - else - cd vim - git pull - git submodule update --init --recursive - cd .. - fi - cd vim - ./configure --with-features=huge \ - --enable-multibyte \ - --enable-rubyinterp \ - --enable-python3interp=yes \ - --enable-luainterp \ - --enable-gui=no \ - --enable-cscope \ - --enable-pythoninterp \ - --enable-python3interp - make -j`nproc` - sudo make install - cd -fi - DIR="$DIR/../" DIR="$DIR" $DIR/common/configure_fresh_system.sh diff --git a/fedora/configure_fresh_system.sh b/fedora/configure_fresh_system.sh index 3099c98b..c998f924 100755 --- a/fedora/configure_fresh_system.sh +++ b/fedora/configure_fresh_system.sh @@ -85,31 +85,6 @@ if [ "$(id -u)" != "0" ]; then code --install-extension webfreak.debug fi -# vim -if [[ -z $NO_COMPILE_VIM ]]; then - VIM_BUILD_DIR=`realpath "$DIR/../../"` - cd "$VIM_BUILD_DIR" - if [[ ! -d vim ]]; then - git clone https://github.com/vim/vim.git --recursive - else - cd vim - git pull - git submodule update --init --recursive - cd .. - fi - cd vim - ./configure --with-features=huge \ - --enable-multibyte \ - --enable-rubyinterp \ - --enable-python3interp=yes \ - --enable-luainterp \ - --enable-gui=no \ - --enable-cscope - make -j`nproc` - sudo make install - cd -fi - DIR="$DIR/../" DIR="$DIR" $DIR/common/configure_fresh_system.sh