aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Smedstad <carl.smedstad@protonmail.com>2021-04-05 01:45:41 +0200
committerHisham Muhammad <hisham@gobolinux.org>2021-04-06 17:24:57 -0300
commitcc0b526646600a94d09e48c4a2f5b3da092b831e (patch)
tree439ae580955c398d53ce8389da9015772ed898cf
parent2f63c2b0c9584aced8578bdb8723eef3e0a4157c (diff)
downloadluarocks-cc0b526646600a94d09e48c4a2f5b3da092b831e.tar.gz
luarocks-cc0b526646600a94d09e48c4a2f5b3da092b831e.tar.bz2
luarocks-cc0b526646600a94d09e48c4a2f5b3da092b831e.zip
Respect the environment variable XDG_CACHE_HOME
This is needed in order to follow the XDG Base Directory specification. More info here: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
-rw-r--r--src/luarocks/core/cfg.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua
index 3c672693..7ea86542 100644
--- a/src/luarocks/core/cfg.lua
+++ b/src/luarocks/core/cfg.lua
@@ -385,7 +385,8 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
385 } 385 }
386 defaults.export_path_separator = ":" 386 defaults.export_path_separator = ":"
387 defaults.wrapper_suffix = "" 387 defaults.wrapper_suffix = ""
388 defaults.local_cache = home.."/.cache/luarocks" 388 local xdg_cache_home = os.getenv("XDG_CACHE_HOME") or home.."/.cache"
389 defaults.local_cache = xdg_cache_home.."/luarocks"
389 if not defaults.variables.CFLAGS:match("-fPIC") then 390 if not defaults.variables.CFLAGS:match("-fPIC") then
390 defaults.variables.CFLAGS = defaults.variables.CFLAGS.." -fPIC" 391 defaults.variables.CFLAGS = defaults.variables.CFLAGS.." -fPIC"
391 end 392 end