1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 07:40:05 +08:00
SpaceVim/.ci/install/linux.sh

55 lines
1.3 KiB
Bash
Raw Normal View History

install_vim() {
2019-10-09 22:57:03 +08:00
local URL=https://github.com/vim/vim
local tag=$1
local ext=$([[ $tag == "HEAD" ]] && echo "" || echo "-b $tag")
local tmp="$(mktemp -d)"
local out="${DEPS}/_vim/$tag"
2019-10-13 22:16:53 +08:00
mkdir -p $out
2019-10-09 22:57:03 +08:00
git clone --depth 1 --single-branch $ext $URL $tmp
cd $tmp
2020-08-29 16:46:57 +08:00
./configure \
2019-10-09 22:57:03 +08:00
--with-features=huge \
--enable-pythoninterp \
--enable-python3interp \
2019-10-13 22:16:53 +08:00
--enable-luainterp \
--prefix=${out}
2020-08-29 16:46:57 +08:00
make
2019-10-13 22:16:53 +08:00
make install
}
2019-10-13 22:16:53 +08:00
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="${DEPS}/_neovim/$tag"
mkdir -p $out
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
2020-09-14 20:49:58 +08:00
pip install pynvim
pip3 install pynvim
2019-10-13 22:16:53 +08:00
}
2019-10-13 22:16:53 +08:00
install() {
local vim=$1
local tag=$2
2019-10-13 22:16:53 +08:00
if [[ -d "${DEPS}/_$vim/$tag/bin" ]]; then
echo "Use a cached version '$HOME/_$vim/$tag'."
return
fi
if [[ $vim == "nvim" ]]; then
install_nvim $tag
else
install_vim $tag
fi
}
2019-10-09 22:57:03 +08:00
2019-10-13 22:16:53 +08:00
install $@