feat: add macOS and Windows shared object support in rocks configuration
This commit is contained in:
@@ -4,18 +4,12 @@
|
|||||||
|
|
||||||
-- ━━━━━━━━━━━━━━━━━━━━━━━━ Bootstrap rocks.nvim ━━━━━━━━━━━━━━━━━━━━━
|
-- ━━━━━━━━━━━━━━━━━━━━━━━━ Bootstrap rocks.nvim ━━━━━━━━━━━━━━━━━━━━━
|
||||||
do
|
do
|
||||||
-- Specifies where to install/use rocks.nvim
|
|
||||||
---@diagnostic disable-next-line: param-type-mismatch
|
|
||||||
local install_location = vim.fs.joinpath(vim.fn.stdpath("data"), "rocks")
|
|
||||||
|
|
||||||
-- Set up configuration options related to rocks.nvim (recommended to leave as default)
|
|
||||||
local rocks_config = {
|
local rocks_config = {
|
||||||
rocks_path = vim.fs.normalize(install_location),
|
rocks_path = vim.env.HOME .. "/.local/share/nvim/rocks",
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.g.rocks_nvim = rocks_config
|
vim.g.rocks_nvim = rocks_config
|
||||||
|
|
||||||
-- Configure the package path (so that plugin code can be found)
|
|
||||||
local luarocks_path = {
|
local luarocks_path = {
|
||||||
vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?.lua"),
|
vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?.lua"),
|
||||||
vim.fs.joinpath(
|
vim.fs.joinpath(
|
||||||
@@ -29,14 +23,17 @@ do
|
|||||||
}
|
}
|
||||||
package.path = package.path .. ";" .. table.concat(luarocks_path, ";")
|
package.path = package.path .. ";" .. table.concat(luarocks_path, ";")
|
||||||
|
|
||||||
-- Configure the C path (so that e.g. tree-sitter parsers can be found)
|
|
||||||
local luarocks_cpath = {
|
local luarocks_cpath = {
|
||||||
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.so"),
|
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.so"),
|
||||||
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.so"),
|
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.so"),
|
||||||
|
-- Remove the dylib and dll paths if you do not need macos or windows support
|
||||||
|
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dylib"),
|
||||||
|
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dylib"),
|
||||||
|
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dll"),
|
||||||
|
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dll"),
|
||||||
}
|
}
|
||||||
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")
|
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")
|
||||||
|
|
||||||
-- Load all installed plugins, including rocks.nvim itself
|
|
||||||
vim.opt.runtimepath:append(
|
vim.opt.runtimepath:append(
|
||||||
vim.fs.joinpath(
|
vim.fs.joinpath(
|
||||||
rocks_config.rocks_path,
|
rocks_config.rocks_path,
|
||||||
@@ -75,3 +72,6 @@ if not pcall(require, "rocks") then
|
|||||||
|
|
||||||
vim.fn.delete(rocks_location, "rf")
|
vim.fn.delete(rocks_location, "rf")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Load plugins ━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||||
|
require("rocks")
|
||||||
|
|||||||
Reference in New Issue
Block a user