Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(luarocks): compatible with PUC Lua #881

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions doc/packer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ REQUIREMENTS *packer-intro-requirements*

- You need to be running Neovim v0.5.0+; `packer` makes use of extmarks and
other newly-added Neovim features.
- Your version of Neovim must be compiled with LuaJIT support; `packer` relies
on this to detect whether you are running Windows or a Unix-like OS (for path
separators)
- If you are on Windows 10, you need developer mode enabled in order to use
local plugins (creating symbolic links requires admin privileges on Windows
- credit to @TimUntersberger for this note)
Expand Down
31 changes: 6 additions & 25 deletions lua/packer/luarocks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,17 @@ local config = nil
local function cfg(_config)
config = _config.luarocks
end
local function warn_need_luajit()
log.error 'LuaJIT is required for Luarocks functionality!'
end

local lua_version = nil
local jit_version
if jit then
local jit_version = string.gsub(jit.version, 'LuaJIT ', '')
lua_version = { lua = string.gsub(_VERSION, 'Lua ', ''), jit = jit_version, dir = jit_version }
else
return {
handle_command = warn_need_luajit,
install_commands = warn_need_luajit,
list = warn_need_luajit,
install_hererocks = warn_need_luajit,
setup_paths = warn_need_luajit,
uninstall = warn_need_luajit,
clean = warn_need_luajit,
install = warn_need_luajit,
ensure = warn_need_luajit,
generate_path_setup = function()
return ''
end,
cfg = cfg,
}
jit_version = string.gsub(jit.version, 'LuaJIT ', '')
end
local lua_version = { lua = string.gsub(_VERSION, 'Lua ', ''), jit = jit_version }

local cache_path = vim.fn.stdpath 'cache'
local rocks_path = util.join_paths(cache_path, 'packer_hererocks')
local hererocks_file = util.join_paths(rocks_path, 'hererocks.py')
local hererocks_install_dir = util.join_paths(rocks_path, lua_version.dir)
local hererocks_install_dir = util.join_paths(rocks_path, lua_version.jit or lua_version.lua)
local shell_hererocks_dir = vim.fn.shellescape(hererocks_install_dir)
local _hererocks_setup_done = false
local function hererocks_is_setup()
Expand Down Expand Up @@ -86,8 +67,8 @@ local function hererocks_installer(disp)
local luarocks_cmd = config.python_cmd
.. ' '
.. hererocks_file
.. ' --verbose -j '
.. lua_version.jit
.. ' --verbose '
.. (lua_version.jit and ('-j ' .. lua_version.jit) or ('-l ' .. lua_version.lua))
.. ' -r latest '
.. hererocks_install_dir
r
Expand Down
3 changes: 0 additions & 3 deletions vim.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ name = "vim"
[vim]
any = true

[jit]
any = true

[[describe.args]]
type = "string"
[[describe.args]]
Expand Down