mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-25 05:23:54 +00:00
luaPackages.sqlite: make it work out of the box
the tests worked because we exported LIBSQLITE. the user had to either set LIBSQLITE himself or set vim.g.sqlite_clib_path. This change overrides vim.g.sqlite_clib_path
(cherry picked from commit 33aa75a8c5
)
This commit is contained in:
parent
3248063613
commit
88f31dcaa4
@ -678,9 +678,15 @@ in
|
||||
doCheck = true;
|
||||
nativeCheckInputs = [ final.plenary-nvim neovim-unwrapped ];
|
||||
|
||||
# the plugin loads the library from either the LIBSQLITE env
|
||||
# or the vim.g.sqlite_clib_path variable.
|
||||
postPatch = ''
|
||||
substituteInPlace lua/sqlite/defs.lua \
|
||||
--replace-fail "path = vim.g.sqlite_clib_path" 'path = vim.g.sqlite_clib_path or "${sqlite.out}/lib/libsqlite3${stdenv.hostPlatform.extensions.sharedLibrary}"'
|
||||
'';
|
||||
|
||||
# we override 'luarocks test' because otherwise neovim doesn't find/load the plenary plugin
|
||||
checkPhase = ''
|
||||
export LIBSQLITE="${sqlite.out}/lib/libsqlite3${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
export HOME="$TMPDIR";
|
||||
|
||||
nvim --headless -i NONE \
|
||||
|
Loading…
Reference in New Issue
Block a user