--- ./src/luarocks/fs/unix/tools.lua.orig	2022-11-01 03:10:35.169749277 +0530
+++ ./src/luarocks/fs/unix/tools.lua	2022-11-01 03:11:27.189749257 +0530
@@ -263,7 +263,7 @@
    assert(type(name_pattern) == "string")
    name_pattern = dir.normalize(name_pattern)

-   local template = (os.getenv("TMPDIR") or "/tmp") .. "/luarocks_" .. name_pattern:gsub("/", "_") .. "-XXXXXX"
+   local template = (os.getenv("TMPDIR") or "@TERMUX_PREFIX@/tmp") .. "/luarocks_" .. name_pattern:gsub("/", "_") .. "-XXXXXX"
    local pipe = io.popen(vars.MKTEMP.." -d "..fs.Q(template))
    local dirname = pipe:read("*l")
    pipe:close()
