mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
build: download busted from own neovim/deps repository
Downloading the necessary files all at once instead of doing dependency handling with luarocks speeds up installation immensely. We speed up the process even more by using luv as a replacement for the C modules in the busted dependencies, which allows us to skip costly compilation times. Co-authored-by: bfredl <bjorn.linse@gmail.com>
This commit is contained in:
parent
4ea4d72af8
commit
f30844008b
@ -316,3 +316,15 @@ ExternalProject_Add(uncrustify
|
||||
EXCLUDE_FROM_ALL TRUE)
|
||||
|
||||
include(BuildLuarocks)
|
||||
|
||||
ExternalProject_Add(busted
|
||||
URL https://github.com/neovim/deps/raw/41d2f1b92aef964c8cb86985768702571e190e96/opt/busted-2.1.1.tar.gz
|
||||
URL_HASH SHA256=9b23efce883ad25a3fe140598a32ab89ecc73f4c3d998cb937293d88e5b4c645
|
||||
DOWNLOAD_NO_PROGRESS TRUE
|
||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/busted
|
||||
SOURCE_DIR ${DEPS_SHARE_DIR}
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
EXCLUDE_FROM_ALL TRUE)
|
||||
add_dependencies(test_deps busted)
|
||||
|
@ -89,10 +89,8 @@ function(Download ROCK VER)
|
||||
endfunction()
|
||||
|
||||
if(WIN32)
|
||||
set(BUSTED_EXE "${DEPS_BIN_DIR}/busted.bat")
|
||||
set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck.bat")
|
||||
else()
|
||||
set(BUSTED_EXE "${DEPS_BIN_DIR}/busted")
|
||||
set(LUACHECK_EXE "${DEPS_BIN_DIR}/luacheck")
|
||||
endif()
|
||||
|
||||
@ -100,9 +98,6 @@ add_custom_target(test_deps)
|
||||
|
||||
Download(luacheck 1.1.0-1 ${LUACHECK_EXE})
|
||||
|
||||
Download(busted 2.1.1 ${BUSTED_EXE})
|
||||
add_dependencies(test_deps busted)
|
||||
|
||||
if(PREFER_LUA)
|
||||
Download(coxpcall 1.17.0-1)
|
||||
add_dependencies(test_deps coxpcall)
|
||||
|
@ -1,6 +1,7 @@
|
||||
set(DEPS_INSTALL_DIR "${CMAKE_BINARY_DIR}/usr")
|
||||
set(DEPS_BIN_DIR "${DEPS_INSTALL_DIR}/bin")
|
||||
set(DEPS_LIB_DIR "${DEPS_INSTALL_DIR}/lib")
|
||||
set(DEPS_SHARE_DIR "${DEPS_INSTALL_DIR}/share/lua/5.1")
|
||||
|
||||
set(DEPS_BUILD_DIR "${CMAKE_BINARY_DIR}/build")
|
||||
set(DEPS_DOWNLOAD_DIR "${DEPS_BUILD_DIR}/downloads")
|
||||
|
@ -140,8 +140,8 @@ void nlua_error(lua_State *const lstate, const char *const msg)
|
||||
}
|
||||
|
||||
if (in_script) {
|
||||
os_errmsg(str);
|
||||
os_errmsg("\n");
|
||||
fprintf(stderr, msg, (int)len, str);
|
||||
fprintf(stderr, "\n");
|
||||
} else {
|
||||
msg_ext_set_kind("lua_error");
|
||||
semsg_multiline(msg, (int)len, str);
|
||||
|
@ -4,4 +4,61 @@ local suffix = (platform and platform.sysname:lower():find'windows') and '.dll'
|
||||
package.path = deps_install_dir.."/share/lua/5.1/?.lua;"..deps_install_dir.."/share/lua/5.1/?/init.lua;"..package.path
|
||||
package.cpath = deps_install_dir.."/lib/lua/5.1/?"..suffix..";"..package.cpath;
|
||||
|
||||
local uv = vim.uv
|
||||
|
||||
local system = {}
|
||||
package.loaded['system.core'] = system
|
||||
function system.monotime()
|
||||
uv.update_time()
|
||||
return uv.now()*1e-3
|
||||
end
|
||||
function system.gettime()
|
||||
local sec, usec = uv.gettimeofday()
|
||||
return sec+usec*1e-6
|
||||
end
|
||||
function system.sleep(sec)
|
||||
uv.sleep(sec*1e3)
|
||||
end
|
||||
|
||||
local term = {}
|
||||
package.loaded['term.core'] = term
|
||||
function term.isatty(_)
|
||||
return uv.guess_handle(1) == 'tty'
|
||||
end
|
||||
|
||||
local lfs = {}
|
||||
package.loaded['lfs'] = lfs
|
||||
|
||||
function lfs.attributes(path, attr)
|
||||
if attr == 'mode' then
|
||||
local stat = uv.fs_stat(path)
|
||||
return stat and stat.type or ''
|
||||
else
|
||||
error('not implemented')
|
||||
end
|
||||
end
|
||||
|
||||
function lfs.currentdir()
|
||||
return uv.cwd()
|
||||
end
|
||||
|
||||
function lfs.chdir(dir)
|
||||
local status, err = pcall(uv.chdir, dir)
|
||||
if status then
|
||||
return true
|
||||
else
|
||||
return nil, err
|
||||
end
|
||||
end
|
||||
|
||||
function lfs.dir(path)
|
||||
local fs = uv.fs_scandir(path)
|
||||
return function()
|
||||
if not fs then
|
||||
return
|
||||
end
|
||||
return uv.fs_scandir_next(fs)
|
||||
end
|
||||
end
|
||||
|
||||
require 'busted.runner'({ standalone = false })
|
||||
|
Loading…
Reference in New Issue
Block a user