1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:40:04 +08:00
SpaceVim/.ci/install/linux.sh
Wang Shidong a830a3e2a4
Update travis setting (#981)
* Update travis setting

* Update after failure script

* Fix lint

* Update comment

* Test bot

* Update ci script

* Update ci

* Test lint

* Update ci

* Check var

* Use log file

* Fix lint

* Check -f

* Lint

* Fix json

* Use vim script instead

* Fixup

* quit afte comment

* Update lint

* Fix lint

* Install gvim

* Remove file

* Install vim before test

* Fix lint

* Fix github api

* Use neovim report error

* Update travis

* Fix unkonwn command

* Use origin/dev

* Update lint

* Fix unkown command

* Fix lint

* Update config

* Fix lint

* Fix cache

* Fix cache

* Fix neovim install

* Fix neovim install

* Fix install

* Use dockerfile

* Fix lint

* Update install script

* Fix lint

* Fix type

* Fix alow faile

* Fix jobs

* Fix docker

* Fix docker

* Fix makefile

* Update commenter vim script
2017-11-22 01:27:35 -06:00

56 lines
1.5 KiB
Bash

install_vim() {
local URL=https://github.com/vim/vim
local tag=$1
local ext=$([[ $tag == "HEAD" ]] && echo "" || echo "-b $tag")
local tmp="$(mktemp -d)"
local out="$HOME/cache/vim-$tag"
local ncpu=$(awk '/^processor/{n+=1}END{print n}' /proc/cpuinfo)
git clone --depth 1 --single-branch $ext $URL $tmp
cd $tmp
./configure --prefix=$out \
--enable-fail-if-missing \
--with-features=huge \
--enable-pythoninterp \
--enable-python3interp \
--enable-luainterp
make -j$ncpu
make install
ln -s $out $HOME/vim
}
install_nvim() {
local URL=https://github.com/neovim/neovim
local tag=$1
local ext=$([[ $tag == "HEAD" ]] && echo "" || echo "-b $tag")
local tmp="$(mktemp -d)"
local out="$HOME/cache/nvim-$tag"
local ncpu=$(awk '/^processor/{n+=1}END{print n}' /proc/cpuinfo)
git clone --depth 1 --single-branch $ext $URL $tmp
cd $tmp
make deps
make -j$ncpu \
CMAKE_BUILD_TYPE=Release \
CMAKE_EXTRA_FLAGS="-DTRAVIS_CI_BUILD=ON -DCMAKE_INSTALL_PREFIX:PATH=$out"
make install
python -m pip install --user neovim
python3 -m pip install --user neovim
ln -sf $out $HOME/vim
}
install() {
local vim=$1
local tag=$2
[[ -d $HOME/vim ]] && rm -f $HOME/vim
if [[ $tag != "HEAD" ]] && [[ -d "$HOME/cache/$vim-$tag" ]]; then
echo "Use a cached version '$HOME/cache/$vim-$tag'."
ln -sf $HOME/cache/$vim-$tag $HOME/vim
return
fi
if [[ $vim == "nvim" ]]; then
install_nvim $tag
else
install_vim $tag
fi
}