aboutsummaryrefslogtreecommitdiff
path: root/install.bat
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-02-17 15:46:01 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-02-18 20:49:05 -0300
commitd83b908a7371360d117cabbf6da099170f5fb178 (patch)
treef795b4f1e362da5d8204a6433ff7927888ada222 /install.bat
parent4eee542ddcbde8df3bd64eee0bda87d6b96e0005 (diff)
downloadluarocks-d83b908a7371360d117cabbf6da099170f5fb178.tar.gz
luarocks-d83b908a7371360d117cabbf6da099170f5fb178.tar.bz2
luarocks-d83b908a7371360d117cabbf6da099170f5fb178.zip
drop cfg.lua_interpreter, use cfg.variables.LUA
Diffstat (limited to 'install.bat')
-rw-r--r--install.bat26
1 files changed, 17 insertions, 9 deletions
diff --git a/install.bat b/install.bat
index 7a5df9cd..e84f78cf 100644
--- a/install.bat
+++ b/install.bat
@@ -15,8 +15,9 @@ vars.TREE_ROOT = nil
15vars.TREE_BIN = nil 15vars.TREE_BIN = nil
16vars.TREE_LMODULE = nil 16vars.TREE_LMODULE = nil
17vars.TREE_CMODULE = nil 17vars.TREE_CMODULE = nil
18vars.LUA_INTERPRETER = nil 18vars.LUA = nil
19vars.LUA_PREFIX = nil 19vars.LUA_PREFIX = nil
20vars.LUA_DIR = nil
20vars.LUA_BINDIR = nil 21vars.LUA_BINDIR = nil
21vars.LUA_INCDIR = nil 22vars.LUA_INCDIR = nil
22vars.LUA_LIBDIR = nil 23vars.LUA_LIBDIR = nil
@@ -320,7 +321,7 @@ local function look_for_interpreter(directory)
320 end 321 end
321 end 322 end
322 323
323 vars.LUA_INTERPRETER = name 324 vars.LUA = full_name
324 vars.LUA_BINDIR = dir 325 vars.LUA_BINDIR = dir
325 return true 326 return true
326 end 327 end
@@ -398,7 +399,7 @@ end
398 399
399local function get_runtime() 400local function get_runtime()
400 local f 401 local f
401 vars.LUA_RUNTIME, f = pe.msvcrt(vars.LUA_BINDIR.."\\"..vars.LUA_INTERPRETER) 402 vars.LUA_RUNTIME, f = pe.msvcrt(vars.LUA)
402 if type(vars.LUA_RUNTIME) ~= "string" then 403 if type(vars.LUA_RUNTIME) ~= "string" then
403 -- analysis failed, issue a warning 404 -- analysis failed, issue a warning
404 vars.LUA_RUNTIME = "MSVCR80" 405 vars.LUA_RUNTIME = "MSVCR80"
@@ -411,9 +412,9 @@ end
411 412
412local function get_architecture() 413local function get_architecture()
413 -- detect processor arch interpreter was compiled for 414 -- detect processor arch interpreter was compiled for
414 local proc = (pe.parse(vars.LUA_BINDIR.."\\"..vars.LUA_INTERPRETER) or {}).Machine 415 local proc = (pe.parse(vars.LUA) or {}).Machine
415 if not proc then 416 if not proc then
416 die("Could not detect processor architecture used in "..vars.LUA_INTERPRETER) 417 die("Could not detect processor architecture used in "..vars.LUA)
417 end 418 end
418 print("arch: " .. proc .. " -> " .. pe.const.Machine[proc]) 419 print("arch: " .. proc .. " -> " .. pe.const.Machine[proc])
419 proc = pe.const.Machine[proc] -- collect name from constant value 420 proc = pe.const.Machine[proc] -- collect name from constant value
@@ -659,6 +660,7 @@ local function look_for_lua_install ()
659 print("Headers found, checking runtime to use...") 660 print("Headers found, checking runtime to use...")
660 if get_runtime() then 661 if get_runtime() then
661 print("Runtime check completed.") 662 print("Runtime check completed.")
663 vars.LUA_DIR = directory
662 return true 664 return true
663 end 665 end
664 end 666 end
@@ -862,7 +864,8 @@ vars.INCDIR = S"$PREFIX\\include"
862vars.LUA_SHORTV = vars.LUA_VERSION:gsub("%.", "") 864vars.LUA_SHORTV = vars.LUA_VERSION:gsub("%.", "")
863 865
864if INSTALL_LUA then 866if INSTALL_LUA then
865 vars.LUA_INTERPRETER = "lua5.1" 867 vars.LUA = vars.BINDIR .. "\\lua5.1.exe"
868 vars.LUA_DIR = vars.PREFIX
866 vars.LUA_BINDIR = vars.BINDIR 869 vars.LUA_BINDIR = vars.BINDIR
867 vars.LUA_LIBDIR = vars.LIBDIR 870 vars.LUA_LIBDIR = vars.LIBDIR
868 vars.LUA_INCDIR = vars.INCDIR 871 vars.LUA_INCDIR = vars.INCDIR
@@ -876,6 +879,9 @@ else
876 vars.UNAME_M = get_architecture() -- can only do when installation was found 879 vars.UNAME_M = get_architecture() -- can only do when installation was found
877end 880end
878 881
882assert(vars.LUA)
883assert(vars.LUA_DIR)
884
879-- check location of system tree 885-- check location of system tree
880if not vars.TREE_ROOT then 886if not vars.TREE_ROOT then
881 -- no system tree location given, so we need to construct a default value 887 -- no system tree location given, so we need to construct a default value
@@ -918,7 +924,7 @@ LuaRocks : $PREFIX
918Config file : $CONFIG_FILE 924Config file : $CONFIG_FILE
919Rocktree : $TREE_ROOT 925Rocktree : $TREE_ROOT
920 926
921Lua interpreter : $LUA_BINDIR\$LUA_INTERPRETER 927Lua interpreter : $LUA
922 binaries : $LUA_BINDIR 928 binaries : $LUA_BINDIR
923 libraries : $LUA_LIBDIR 929 libraries : $LUA_LIBDIR
924 includes : $LUA_INCDIR 930 includes : $LUA_INCDIR
@@ -1031,7 +1037,7 @@ IF NOT "%LUA_PATH_5_3%"=="" (
1031 SET "LUA_PATH_5_3=$LUADIR\?.lua;$LUADIR\?\init.lua;%LUA_PATH_5_3%" 1037 SET "LUA_PATH_5_3=$LUADIR\?.lua;$LUADIR\?\init.lua;%LUA_PATH_5_3%"
1032) 1038)
1033SET "PATH=$BINDIR;%PATH%" 1039SET "PATH=$BINDIR;%PATH%"
1034"$LUA_BINDIR\$LUA_INTERPRETER" "$BINDIR\]]..c..[[.lua" %* 1040"$LUA" "$BINDIR\]]..c..[[.lua" %*
1035SET EXITCODE=%ERRORLEVEL% 1041SET EXITCODE=%ERRORLEVEL%
1036IF NOT "%EXITCODE%"=="2" GOTO EXITLR 1042IF NOT "%EXITCODE%"=="2" GOTO EXITLR
1037 1043
@@ -1087,10 +1093,12 @@ vars.SYSTEM = USE_MINGW and "mingw" or "windows"
1087local f = io.open(hardcoded_lua, "w") 1093local f = io.open(hardcoded_lua, "w")
1088f:write(S[=[ 1094f:write(S[=[
1089return { 1095return {
1096 LUA_DIR=[[$LUA_DIR]],
1090 LUA_INCDIR=[[$LUA_INCDIR]], 1097 LUA_INCDIR=[[$LUA_INCDIR]],
1091 LUA_LIBDIR=[[$LUA_LIBDIR]], 1098 LUA_LIBDIR=[[$LUA_LIBDIR]],
1092 LUA_BINDIR=[[$LUA_BINDIR]], 1099 LUA_BINDIR=[[$LUA_BINDIR]],
1093 LUA_INTERPRETER=[[$LUA_INTERPRETER]], 1100 LUA_VERSION=[[$LUA_VERSION]],
1101 LUA=[[$LUA]],
1094 SYSTEM = [[$SYSTEM]], 1102 SYSTEM = [[$SYSTEM]],
1095 PROCESSOR = [[$UNAME_M]], 1103 PROCESSOR = [[$UNAME_M]],
1096 PREFIX = [[$PREFIX]], 1104 PREFIX = [[$PREFIX]],