luaPackages: use writableTmpDirAsHomeHook

Replace manual workaounds with hook.
This commit is contained in:
Austin Horstman
2025-02-17 09:21:10 -06:00
parent eedabef03a
commit 25b5a22bea
+16 -18
View File
@@ -501,10 +501,10 @@ in
final.nlua
final.busted
gitMinimal
writableTmpDirAsHomeHook
];
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
busted --lua=nlua --lpath='lua/?.lua' --lpath='lua/?/init.lua' tests/
runHook postCheck
'';
@@ -696,10 +696,10 @@ in
nativeCheckInputs = [
final.nlua
final.busted
writableTmpDirAsHomeHook
];
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
busted --lua=nlua
runHook postCheck
'';
@@ -710,10 +710,10 @@ in
nativeCheckInputs = [
final.nlua
final.busted
writableTmpDirAsHomeHook
];
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
busted --lua=nlua
runHook postCheck
'';
@@ -741,11 +741,11 @@ in
final.nlua
final.busted
neovim-unwrapped
writableTmpDirAsHomeHook
];
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
export LUA_PATH="./lua/?.lua;./lua/?/init.lua;$LUA_PATH"
nvim --headless -i NONE \
--cmd "set rtp+=${vimPlugins.plenary-nvim}" \
@@ -760,10 +760,10 @@ in
nativeCheckInputs = [
final.nlua
final.busted
writableTmpDirAsHomeHook
];
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
busted --lua=nlua
runHook postCheck
'';
@@ -782,12 +782,12 @@ in
nativeCheckInputs = [
final.nlua
final.busted
writableTmpDirAsHomeHook
];
# upstream uses PlenaryBusted which is a pain to setup
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
busted --lua=nlua --lpath='lua/?.lua' --lpath='lua/?/init.lua' tests/
runHook postCheck
'';
@@ -807,13 +807,13 @@ in
neovim-unwrapped
coreutils
findutils
writableTmpDirAsHomeHook
];
checkPhase = ''
runHook preCheck
# remove failing tests, need internet access for instance
rm tests/plenary/job_spec.lua tests/plenary/scandir_spec.lua tests/plenary/curl_spec.lua
export HOME="$TMPDIR"
make test
runHook postCheck
'';
@@ -982,10 +982,10 @@ in
nativeCheckInputs = [
final.nlua
final.busted
writableTmpDirAsHomeHook
];
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
busted --lua=nlua
runHook postCheck
'';
@@ -996,10 +996,10 @@ in
nativeCheckInputs = [
final.nlua
final.busted
writableTmpDirAsHomeHook
];
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
busted --lua=nlua
runHook postCheck
'';
@@ -1010,6 +1010,7 @@ in
nativeCheckInputs = [
final.plenary-nvim
neovim-unwrapped
writableTmpDirAsHomeHook
];
# the plugin loads the library from either the LIBSQLITE env
@@ -1021,8 +1022,6 @@ in
# we override 'luarocks test' because otherwise neovim doesn't find/load the plenary plugin
checkPhase = ''
export HOME="$TMPDIR";
nvim --headless -i NONE \
-u test/minimal_init.vim --cmd "set rtp+=${vimPlugins.plenary-nvim}" \
-c "PlenaryBustedDirectory test/auto/ { sequential = true, minimal_init = './test/minimal_init.vim' }"
@@ -1093,9 +1092,9 @@ in
tree-sitter
];
preInstall = ''
export HOME="$TMPDIR";
'';
nativeBuildInputs = oa.nativeBuildInputs or [ ] ++ [
writableTmpDirAsHomeHook
];
});
tree-sitter-norg = prev.tree-sitter-norg.overrideAttrs (oa: {
@@ -1123,10 +1122,9 @@ in
lua.pkgs.luarocks-build-treesitter-parser
tree-sitter
];
preInstall = ''
export HOME="$TMPDIR";
'';
nativeBuildInputs = oa.nativeBuildInputs or [ ] ++ [
writableTmpDirAsHomeHook
];
});
vstruct = prev.vstruct.overrideAttrs (_: {