1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 10:40:03 +08:00

Fix lint build vim (#3144)

This commit is contained in:
Wang Shidong 2019-10-13 22:16:53 +08:00 committed by GitHub
parent 7de3d133a4
commit 674c3c09ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 171 additions and 43 deletions

View File

@ -60,11 +60,83 @@ function install_nvim($name)
$ver = $name -replace "^Neovim\s*", ""
if ($ver -eq "latest-32")
{
$url = 'https://ci.appveyor.com/api/projects/neovim/neovim/artifacts/build/Neovim.zip?branch=master&job=Configuration%3A%20MINGW_32'
$url = 'https://github.com/neovim/neovim/releases/download/nightly/nvim-win32.zip'
}
elseif ($ver -eq "latest-64")
{
$url = 'https://ci.appveyor.com/api/projects/neovim/neovim/artifacts/build/Neovim.zip?branch=master&job=Configuration%3A%20MINGW_64'
$url = 'https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip'
}
elseif ($ver -eq "0.3.8-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.8/nvim-win32.zip'
}
elseif ($ver -eq "0.3.8-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.8/nvim-win64.zip'
}
elseif ($ver -eq "0.3.7-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.7/nvim-win32.zip'
}
elseif ($ver -eq "0.3.7-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.7/nvim-win64.zip'
}
elseif ($ver -eq "0.3.5-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.5/nvim-win32.zip'
}
elseif ($ver -eq "0.3.5-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.5/nvim-win64.zip'
}
elseif ($ver -eq "0.3.4-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.4/nvim-win32.zip'
}
elseif ($ver -eq "0.3.4-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.4/nvim-win64.zip'
}
elseif ($ver -eq "0.3.3-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.3/nvim-win32.zip'
}
elseif ($ver -eq "0.3.3-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.3/nvim-win64.zip'
}
elseif ($ver -eq "0.3.2-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.2/nvim-win32.zip'
}
elseif ($ver -eq "0.3.2-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.2/nvim-win64.zip'
}
elseif ($ver -eq "0.3.1-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.1/nvim-win32.zip'
}
elseif ($ver -eq "0.3.1-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.1/nvim-win64.zip'
}
elseif ($ver -eq "0.3.0-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.0/nvim-win32.zip'
}
elseif ($ver -eq "0.3.0-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.3.0/nvim-win64.zip'
}
elseif ($ver -eq "0.2.2-32")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.2.2/nvim-win32.zip'
}
elseif ($ver -eq "0.2.2-64")
{
$url = 'https://github.com/neovim/neovim/releases/download/v0.2.2/nvim-win64.zip'
}
elseif ($ver -eq "0.2.0-32")
{

View File

@ -4,51 +4,52 @@ install_vim() {
local ext=$([[ $tag == "HEAD" ]] && echo "" || echo "-b $tag")
local tmp="$(mktemp -d)"
local out="${DEPS}/_vim/$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
./configure --prefix=$out \
--enable-fail-if-missing \
./configure --enable-fail-if-missing \
--with-features=huge \
--enable-pythoninterp \
--enable-python3interp \
--enable-luainterp
make -j$ncpu
make install
}
--enable-luainterp \
--prefix=${out}
make -j$ncpu
make install
}
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"
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 pynvim
python3 -m pip install pynvim
}
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
pip install --user pynvim
pip3 install --user pynvim
}
install() {
local vim=$1
local tag=$2
install() {
local vim=$1
local tag=$2
if [[ -d "${DEPS}/_$vim/$tag" ]]; then
echo "Use a cached version '$HOME/_$vim/$tag'."
return
fi
if [[ $vim == "nvim" ]]; then
install_nvim $tag
else
install_vim $tag
fi
tree "${DEPS}/_$vim/$tag"
}
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
}
install $@
install $@

View File

@ -27,6 +27,29 @@ env:
- DEPS=$HOME/deps
- PATH=$DEPS/bin:$HOME/vim/bin:$PATH
addons:
apt:
packages:
- python3-pip
- python-pip
- libncurses5-dev
- libgnome2-dev
- libgnomeui-dev
- libgtk2.0-dev
- libatk1.0-dev
- libbonoboui2-dev
- libcairo2-dev
- libx11-dev
- libxpm-dev
- libxt-dev
- python-dev
- python3-dev
- ruby-dev
- lua5.1
- liblua5.1-dev
- libperl-dev
- ninja-build
jobs:
include:
- env: LINT=jekyll
@ -37,12 +60,29 @@ jobs:
- env: LINT=vint VIM_BIN=nvim VIM_TAG=v0.2.0
- env: LINT=vader VIM_BIN=nvim VIM_TAG=nightly
addons: { apt: { packages: [python2.7-dev, lua5.2] } }
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.4.2
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.4.1
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.4.0
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.8
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.7
addons: { apt: { packages: [python2.7-dev, lua5.2] } }
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.6
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.5
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.4
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.3
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.2
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.1
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.3.0
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.2.2
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.2.0
- env: LINT=vader VIM_BIN=nvim VIM_TAG=v0.1.7
- env: LINT=vader VIM_BIN=vim VIM_TAG=v7.4.052 #ubuntu 14.04
addons: { apt: { packages: [libncurses5-dev, libncursesw5-dev] } }
- env: LINT=vader VIM_BIN=vim VIM_TAG=v7.4.1689 #ubuntu 16.04
addons: { apt: { packages: [libncurses5-dev, libncursesw5-dev] } }
- env: LINT=vader VIM_BIN=vim VIM_TAG=v8.0.1453 #ubuntu 18.04
addons: { apt: { packages: [libncurses5-dev, libncursesw5-dev] } }
- env: LINT=vader VIM_BIN=vim VIM_TAG=v8.1.0320 #ubuntu 19.04
addons: { apt: { packages: [libncurses5-dev, libncursesw5-dev] } }
allow_failures:
- env: LINT=vimlint VIM_BIN=nvim VIM_TAG=v0.2.0
- env: LINT=vint VIM_BIN=nvim VIM_TAG=v0.2.0

View File

@ -5,6 +5,17 @@ skip_tags: true
clone_depth: 1
environment:
matrix:
- CONDITION: Neovim latest-32
- CONDITION: Neovim 0.3.8-32
- CONDITION: Neovim 0.3.7-32
- CONDITION: Neovim 0.3.5-32
- CONDITION: Neovim 0.3.4-32
- CONDITION: Neovim 0.3.3-32
- CONDITION: Neovim 0.3.2-32
- CONDITION: Neovim 0.3.1-32
- CONDITION: Neovim 0.3.0-32
- CONDITION: Neovim 0.2.2-32
- CONDITION: Neovim 0.2.0-32
- CONDITION: Official latest-32
install:
- 'reg copy HKLM\SOFTWARE\Python\PythonCore\2.7 HKLM\SOFTWARE\Python\PythonCore\2.7-32 /s /reg:32'

View File

@ -138,7 +138,9 @@ function! s:self.get(url, ...) abort
endif
if executable('curl')
let command = printf('curl -q %s -s -k -i', follow ? '-L' : '')
let quote = &shellxquote ==# '"' ? "'" : '"'
" let quote = &shellxquote ==# '"' ? "'" : '"'
" @fixme this line failed on windows
let quote = '"'
for key in keys(headdata)
if has('win32')
let command .= ' -H ' . quote . key . ': ' . substitute(headdata[key], '"', '"""', 'g') . quote
@ -150,7 +152,8 @@ function! s:self.get(url, ...) abort
let res = s:system(command)
elseif executable('wget')
let command = printf('wget -O- --save-headers --server-response -q %s', follow ? '-L' : '')
let quote = &shellxquote ==# '"' ? "'" : '"'
" let quote = &shellxquote ==# '"' ? "'" : '"'
let quote = '"'
for key in keys(headdata)
if has('win32')
let command .= ' --header=' . quote . key . ': ' . substitute(headdata[key], '"', '"""', 'g') . quote

View File

@ -5,5 +5,6 @@ Execute ( SpaceVim api: SpaceVim main code ):
else
source vimrc
endif
let g:spacevim_update_retry_cnt = 0
SPInstall
AssertEqual fnamemodify(g:_spacevim_root_dir, ':.'), ''