aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2025-12-26 22:30:36 +1100
committerdaurnimator <quae@daurnimator.com>2025-12-26 22:30:36 +1100
commit6b7b6c2506f9abef059794663a8598a736837cc4 (patch)
tree4630dac80568c9377ff4cc1bcadef2c5fe9f7a6b
parentddb1c93bf93c9774cb9d854a665d51c369ea5acd (diff)
parent24a9abaf330daf6882292a55256cf81dbdc5b622 (diff)
downloadluarocks-6b7b6c2506f9abef059794663a8598a736837cc4.tar.gz
luarocks-6b7b6c2506f9abef059794663a8598a736837cc4.tar.bz2
luarocks-6b7b6c2506f9abef059794663a8598a736837cc4.zip
Merge remote-tracking branch 'origin/refs/pull/1844/head'
-rw-r--r--GNUmakefile2
-rwxr-xr-xbinary/all_in_one2
-rw-r--r--binary/luaposix-35.1-1.rockspec2
-rwxr-xr-xconfigure18
-rw-r--r--install.bat20
-rw-r--r--spec/init_spec.lua4
-rw-r--r--spec/util/test_env.lua4
-rw-r--r--src/luarocks/cmd/write_rockspec.lua10
-rw-r--r--src/luarocks/cmd/write_rockspec.tl12
-rw-r--r--src/luarocks/core/util.lua2
-rw-r--r--src/luarocks/core/util.tl2
-rw-r--r--src/luarocks/deps.lua10
-rw-r--r--src/luarocks/deps.tl10
-rw-r--r--src/luarocks/fs/lua.lua1
-rw-r--r--src/luarocks/fs/win32/tools.lua3
-rw-r--r--src/luarocks/tools/patch.lua1
-rw-r--r--src/luarocks/tools/patch.tl1
-rw-r--r--src/luarocks/util.lua6
-rw-r--r--src/luarocks/util.tl6
19 files changed, 83 insertions, 33 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 46be0cc6..37cfdf7d 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -16,7 +16,7 @@ buildbinarydir = ./build-binary
16 16
17LUAROCKS_FILES = $(shell find src/luarocks/ -type f -name '*.lua') 17LUAROCKS_FILES = $(shell find src/luarocks/ -type f -name '*.lua')
18 18
19LUA_ENV_VARS = LUA_PATH LUA_PATH_5_2 LUA_PATH_5_3 LUA_PATH_5_4 LUA_CPATH LUA_CPATH_5_2 LUA_CPATH_5_3 LUA_CPATH_5_4 19LUA_ENV_VARS = LUA_PATH LUA_PATH_5_2 LUA_PATH_5_3 LUA_PATH_5_4 LUA_PATH_5_5 LUA_CPATH LUA_CPATH_5_2 LUA_CPATH_5_3 LUA_CPATH_5_4 LUA_CPATH_5_5
20 20
21all: build 21all: build
22 22
diff --git a/binary/all_in_one b/binary/all_in_one
index 9b675eba..e3d595d7 100755
--- a/binary/all_in_one
+++ b/binary/all_in_one
@@ -69,7 +69,7 @@ local function reindent_c(input)
69 local indent = 0 69 local indent = 0
70 local previous_is_blank = true 70 local previous_is_blank = true
71 for line in input:gmatch("([^\n]*)") do 71 for line in input:gmatch("([^\n]*)") do
72 line = line:match("^[ \t]*(.-)[ \t]*$") 72 local line = line:match("^[ \t]*(.-)[ \t]*$")
73 73
74 local is_blank = (#line == 0) 74 local is_blank = (#line == 0)
75 local do_print = 75 local do_print =
diff --git a/binary/luaposix-35.1-1.rockspec b/binary/luaposix-35.1-1.rockspec
index 1940c755..0f23d39d 100644
--- a/binary/luaposix-35.1-1.rockspec
+++ b/binary/luaposix-35.1-1.rockspec
@@ -14,7 +14,7 @@ description = {
14} 14}
15 15
16dependencies = { 16dependencies = {
17 'lua >= 5.1, < 5.5', 17 'lua >= 5.1, < 5.6',
18} 18}
19 19
20do 20do
diff --git a/configure b/configure
index cc3e9dab..4c294105 100755
--- a/configure
+++ b/configure
@@ -120,7 +120,7 @@ Where to install files provided by rocks:
120 - Default is [PREFIX] 120 - Default is [PREFIX]
121 121
122Where is your Lua interpreter: 122Where is your Lua interpreter:
123 --lua-version=VERSION Use specific Lua version: 5.1, 5.2, 5.3, or 5.4 123 --lua-version=VERSION Use specific Lua version: 5.1, 5.2, 5.3, 5.4 or 5.5
124 - Default is auto-detected. 124 - Default is auto-detected.
125 --with-lua-bin=LUA_BINDIR Location of your Lua binar(y/ies). 125 --with-lua-bin=LUA_BINDIR Location of your Lua binar(y/ies).
126 - Default is the directory of the 126 - Default is the directory of the
@@ -151,7 +151,7 @@ EOF
151# ------------- 151# -------------
152 152
153detect_lua_version() { 153detect_lua_version() {
154 detected_lua=$($1 -e 'print(_VERSION:match(" (5%.[1234])$"))' 2> /dev/null) 154 detected_lua=$($1 -e 'print(_VERSION:match(" (5%.[12345])$"))' 2> /dev/null)
155 if [ "$detected_lua" != "nil" ] 155 if [ "$detected_lua" != "nil" ]
156 then 156 then
157 if [ "$LUA_VERSION_SET" != "yes" ] 157 if [ "$LUA_VERSION_SET" != "yes" ]
@@ -258,7 +258,7 @@ do
258 [ -n "$value" ] || die "Missing value in flag $key." 258 [ -n "$value" ] || die "Missing value in flag $key."
259 LUA_VERSION="$value" 259 LUA_VERSION="$value"
260 case "$LUA_VERSION" in 260 case "$LUA_VERSION" in
261 5.1|5.2|5.3|5.4) ;; 261 5.1|5.2|5.3|5.4|5.5) ;;
262 *) die "Invalid Lua version in flag $key." 262 *) die "Invalid Lua version in flag $key."
263 esac 263 esac
264 LUA_VERSION_SET=yes 264 LUA_VERSION_SET=yes
@@ -362,8 +362,11 @@ case "$LUA_VERSION" in
3625.4) 3625.4)
363 names="lua5.4 lua54 lua-5.4 lua-54 lua" 363 names="lua5.4 lua54 lua-5.4 lua-54 lua"
364 ;; 364 ;;
3655.5)
366 names="lua5.5 lua55 lua-5.5 lua-55 lua"
367 ;;
365*) 368*)
366 names="lua5.4 lua54 lua-5.4 lua-54 lua5.3 lua53 lua-5.3 lua-53 lua5.2 lua52 lua-5.2 lua-52 lua5.1 lua51 lua-5.1 lua-51 luajit lua" 369 names="lua5.5 lua55 lua-5.5 lua-55 lua5.4 lua54 lua-5.4 lua-54 lua5.3 lua53 lua-5.3 lua-53 lua5.2 lua52 lua-5.2 lua-52 lua5.1 lua51 lua-5.1 lua-51 luajit lua"
367 ;; 370 ;;
368esac 371esac
369 372
@@ -438,7 +441,12 @@ check_incdir() {
438 do 441 do
439 if [ -f "$lua_h" ] 442 if [ -f "$lua_h" ]
440 then 443 then
441 grep "LUA_VERSION_NUM.*$LUA_VERSION" "$lua_h" > /dev/null 2> /dev/null && return 444 if [ "$LUA_VERSION" = "5.5" ]
445 then
446 grep "LUA_VERSION_MINOR_N.*5" "$lua_h" > /dev/null 2> /dev/null && return
447 else
448 grep "LUA_VERSION_NUM.*$LUA_VERSION" "$lua_h" > /dev/null 2> /dev/null && return
449 fi
442 fi 450 fi
443 tried="$tried $lua_h" 451 tried="$tried $lua_h"
444 done 452 done
diff --git a/install.bat b/install.bat
index 6dd71125..25fc697e 100644
--- a/install.bat
+++ b/install.bat
@@ -136,7 +136,7 @@ Configuring the destinations:
136 if you create a self contained installation. 136 if you create a self contained installation.
137 137
138Configuring the Lua interpreter: 138Configuring the Lua interpreter:
139/LV [version] Lua version to use; either 5.1, 5.2, 5.3, or 5.4. 139/LV [version] Lua version to use; either 5.1, 5.2, 5.3, 5.4 or 5.5.
140 Default is auto-detected. 140 Default is auto-detected.
141/LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ 141/LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\
142 If not provided, the installer will search the system 142 If not provided, the installer will search the system
@@ -258,8 +258,8 @@ local function check_flags()
258 die("Bundled Lua version is 5.1, cannot install "..vars.LUA_VERSION) 258 die("Bundled Lua version is 5.1, cannot install "..vars.LUA_VERSION)
259 end 259 end
260 end 260 end
261 if not vars.LUA_VERSION:match("^5%.[1234]$") then 261 if not vars.LUA_VERSION:match("^5%.[12345]$") then
262 die("Bad argument: /LV must either be 5.1, 5.2, 5.3, or 5.4") 262 die("Bad argument: /LV must either be 5.1, 5.2, 5.3, 5.4 or 5.5")
263 end 263 end
264 if USE_MSVC_MANUAL and USE_MINGW then 264 if USE_MSVC_MANUAL and USE_MINGW then
265 die("Cannot combine option /MSVC and /MW") 265 die("Cannot combine option /MSVC and /MW")
@@ -277,7 +277,7 @@ local function detect_lua_version(interpreter_path)
277 local full_version = handler:read("*a") 277 local full_version = handler:read("*a")
278 handler:close() 278 handler:close()
279 279
280 local version = full_version:match(" (5%.[1234])$") 280 local version = full_version:match(" (5%.[12345])$")
281 if not version then 281 if not version then
282 return nil, "unknown interpreter version '" .. full_version .. "'" 282 return nil, "unknown interpreter version '" .. full_version .. "'"
283 end 283 end
@@ -289,7 +289,7 @@ local function look_for_interpreter(directory)
289 if lua_version_set then 289 if lua_version_set then
290 names = {S"lua$LUA_VERSION.exe", S"lua$LUA_SHORTV.exe"} 290 names = {S"lua$LUA_VERSION.exe", S"lua$LUA_SHORTV.exe"}
291 else 291 else
292 names = {"lua5.4.exe", "lua54.exe", "lua5.3.exe", "lua53.exe", "lua5.2.exe", "lua52.exe", "lua5.1.exe", "lua51.exe"} 292 names = {"lua5.5.exe", "lua55.exe", "lua5.4.exe", "lua54.exe", "lua5.3.exe", "lua53.exe", "lua5.2.exe", "lua52.exe", "lua5.1.exe", "lua51.exe"}
293 end 293 end
294 table.insert(names, "lua.exe") 294 table.insert(names, "lua.exe")
295 table.insert(names, "luajit.exe") 295 table.insert(names, "luajit.exe")
@@ -622,7 +622,7 @@ local function get_possible_lua_directories()
622 local directories = {} 622 local directories = {}
623 for dir in path:gmatch("[^;]+") do 623 for dir in path:gmatch("[^;]+") do
624 -- Remove trailing backslashes, but not from a drive letter like `C:\`. 624 -- Remove trailing backslashes, but not from a drive letter like `C:\`.
625 dir = dir:gsub("([^:])\\+$", "%1") 625 local dir = dir:gsub("([^:])\\+$", "%1")
626 -- Remove trailing `bin` subdirectory, the searcher will check there anyway. 626 -- Remove trailing `bin` subdirectory, the searcher will check there anyway.
627 if dir:upper():match("[:\\]BIN$") then 627 if dir:upper():match("[:\\]BIN$") then
628 dir = dir:sub(1, -5) 628 dir = dir:sub(1, -5)
@@ -1024,7 +1024,7 @@ end
1024if not exec(S[[XCOPY /S src\luarocks\*.* "$LUADIR\luarocks" >NUL]]) then 1024if not exec(S[[XCOPY /S src\luarocks\*.* "$LUADIR\luarocks" >NUL]]) then
1025 die() 1025 die()
1026end 1026end
1027if vars.LUA_VERSION ~= "5.3" or vars.LUA_VERSION ~= "5.4" then 1027if vars.LUA_VERSION ~= "5.3" or vars.LUA_VERSION ~= "5.4" or vars.LUA_VERSION ~= "5.5" then
1028 -- Copy the vendored lua-copmat53 source files 1028 -- Copy the vendored lua-copmat53 source files
1029 if not exists(S[[$LUADIR\compat53]]) then 1029 if not exists(S[[$LUADIR\compat53]]) then
1030 if not mkdir(S[[$LUADIR\compat53]]) then 1030 if not mkdir(S[[$LUADIR\compat53]]) then
@@ -1058,6 +1058,12 @@ IF NOT "%LUA_PATH_5_2%"=="" (
1058IF NOT "%LUA_PATH_5_3%"=="" ( 1058IF NOT "%LUA_PATH_5_3%"=="" (
1059 SET "LUA_PATH_5_3=$LUADIR\?.lua;$LUADIR\?\init.lua;%LUA_PATH_5_3%" 1059 SET "LUA_PATH_5_3=$LUADIR\?.lua;$LUADIR\?\init.lua;%LUA_PATH_5_3%"
1060) 1060)
1061IF NOT "%LUA_PATH_5_4%"=="" (
1062 SET "LUA_PATH_5_4=$LUADIR\?.lua;$LUADIR\?\init.lua;%LUA_PATH_5_4%"
1063)
1064IF NOT "%LUA_PATH_5_5%"=="" (
1065 SET "LUA_PATH_5_5=$LUADIR\?.lua;$LUADIR\?\init.lua;%LUA_PATH_5_5%"
1066)
1061SET "PATH=$BINDIR;%PATH%" 1067SET "PATH=$BINDIR;%PATH%"
1062"$LUA" "$BINDIR\]]..c..[[.lua" %* 1068"$LUA" "$BINDIR\]]..c..[[.lua" %*
1063SET EXITCODE=%ERRORLEVEL% 1069SET EXITCODE=%ERRORLEVEL%
diff --git a/spec/init_spec.lua b/spec/init_spec.lua
index 88bd23a5..6cc0dd90 100644
--- a/spec/init_spec.lua
+++ b/spec/init_spec.lua
@@ -153,13 +153,13 @@ describe("luarocks init #integration", function()
153 lfs.mkdir(myproject) 153 lfs.mkdir(myproject)
154 lfs.chdir(myproject) 154 lfs.chdir(myproject)
155 155
156 assert(run.luarocks("init --lua-versions=5.1,5.2,5.3,5.4")) 156 assert(run.luarocks("init --lua-versions=5.1,5.2,5.3,5.4,5.5"))
157 local rockspec_name = myproject .. "/myproject-dev-1.rockspec" 157 local rockspec_name = myproject .. "/myproject-dev-1.rockspec"
158 assert.truthy(lfs.attributes(rockspec_name)) 158 assert.truthy(lfs.attributes(rockspec_name))
159 local fd = assert(io.open(rockspec_name, "rb")) 159 local fd = assert(io.open(rockspec_name, "rb"))
160 local data = fd:read("*a") 160 local data = fd:read("*a")
161 fd:close() 161 fd:close()
162 assert.truthy(data:find("lua >= 5.1, < 5.5", 1, true)) 162 assert.truthy(data:find("lua >= 5.1, < 5.6", 1, true))
163 end, finally) 163 end, finally)
164 end) 164 end)
165 165
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua
index 390ba01c..4b359b7f 100644
--- a/spec/util/test_env.lua
+++ b/spec/util/test_env.lua
@@ -250,6 +250,10 @@ function test_env.execute_helper(command, print_command, env_variables)
250 "LUA_CPATH_5_2", 250 "LUA_CPATH_5_2",
251 "LUA_PATH_5_3", 251 "LUA_PATH_5_3",
252 "LUA_CPATH_5_3", 252 "LUA_CPATH_5_3",
253 "LUA_PATH_5_4",
254 "LUA_CPATH_5_4",
255 "LUA_PATH_5_5",
256 "LUA_CPATH_5_5",
253 "LUAROCKS_SYSCONFDIR", 257 "LUAROCKS_SYSCONFDIR",
254 } 258 }
255 259
diff --git a/src/luarocks/cmd/write_rockspec.lua b/src/luarocks/cmd/write_rockspec.lua
index b84c2803..5710c982 100644
--- a/src/luarocks/cmd/write_rockspec.lua
+++ b/src/luarocks/cmd/write_rockspec.lua
@@ -28,12 +28,17 @@ local lua_versions = {
28 "5.2", 28 "5.2",
29 "5.3", 29 "5.3",
30 "5.4", 30 "5.4",
31 "5.5",
31 "5.1,5.2", 32 "5.1,5.2",
32 "5.2,5.3", 33 "5.2,5.3",
33 "5.3,5.4", 34 "5.3,5.4",
35 "5.4,5.5",
34 "5.1,5.2,5.3", 36 "5.1,5.2,5.3",
35 "5.2,5.3,5.4", 37 "5.2,5.3,5.4",
38 "5.3,5.4,5.5",
36 "5.1,5.2,5.3,5.4", 39 "5.1,5.2,5.3,5.4",
40 "5.2,5.3,5.4,5.5",
41 "5.1,5.2,5.3,5.4,5.5",
37} 42}
38 43
39function write_rockspec.cmd_options(parser) 44function write_rockspec.cmd_options(parser)
@@ -110,12 +115,17 @@ local lua_version_dep = {
110 ["5.2"] = "lua ~> 5.2", 115 ["5.2"] = "lua ~> 5.2",
111 ["5.3"] = "lua ~> 5.3", 116 ["5.3"] = "lua ~> 5.3",
112 ["5.4"] = "lua ~> 5.4", 117 ["5.4"] = "lua ~> 5.4",
118 ["5.5"] = "lua ~> 5.5",
113 ["5.1,5.2"] = "lua >= 5.1, < 5.3", 119 ["5.1,5.2"] = "lua >= 5.1, < 5.3",
114 ["5.2,5.3"] = "lua >= 5.2, < 5.4", 120 ["5.2,5.3"] = "lua >= 5.2, < 5.4",
115 ["5.3,5.4"] = "lua >= 5.3, < 5.5", 121 ["5.3,5.4"] = "lua >= 5.3, < 5.5",
122 ["5.4,5.5"] = "lua >= 5.4, < 5.6",
116 ["5.1,5.2,5.3"] = "lua >= 5.1, < 5.4", 123 ["5.1,5.2,5.3"] = "lua >= 5.1, < 5.4",
117 ["5.2,5.3,5.4"] = "lua >= 5.2, < 5.5", 124 ["5.2,5.3,5.4"] = "lua >= 5.2, < 5.5",
125 ["5.3,5.4,5.5"] = "lua >= 5.3, < 5.6",
118 ["5.1,5.2,5.3,5.4"] = "lua >= 5.1, < 5.5", 126 ["5.1,5.2,5.3,5.4"] = "lua >= 5.1, < 5.5",
127 ["5.2,5.3,5.4,5.5"] = "lua >= 5.2, < 5.6",
128 ["5.1,5.2,5.3,5.4,5.5"] = "lua >= 5.1, < 5.6",
119} 129}
120 130
121local simple_scm_protocols = { 131local simple_scm_protocols = {
diff --git a/src/luarocks/cmd/write_rockspec.tl b/src/luarocks/cmd/write_rockspec.tl
index 7354a683..2ec4eea9 100644
--- a/src/luarocks/cmd/write_rockspec.tl
+++ b/src/luarocks/cmd/write_rockspec.tl
@@ -28,12 +28,17 @@ local lua_versions = {
28 "5.2", 28 "5.2",
29 "5.3", 29 "5.3",
30 "5.4", 30 "5.4",
31 "5.5",
31 "5.1,5.2", 32 "5.1,5.2",
32 "5.2,5.3", 33 "5.2,5.3",
33 "5.3,5.4", 34 "5.3,5.4",
35 "5.4,5.5",
34 "5.1,5.2,5.3", 36 "5.1,5.2,5.3",
35 "5.2,5.3,5.4", 37 "5.2,5.3,5.4",
36 "5.1,5.2,5.3,5.4" 38 "5.3,5.4,5.5",
39 "5.1,5.2,5.3,5.4",
40 "5.2,5.3,5.4,5.5",
41 "5.1,5.2,5.3,5.4,5.5",
37} 42}
38 43
39function write_rockspec.cmd_options(parser: Parser) 44function write_rockspec.cmd_options(parser: Parser)
@@ -110,12 +115,17 @@ local lua_version_dep = {
110 ["5.2"] = "lua ~> 5.2", 115 ["5.2"] = "lua ~> 5.2",
111 ["5.3"] = "lua ~> 5.3", 116 ["5.3"] = "lua ~> 5.3",
112 ["5.4"] = "lua ~> 5.4", 117 ["5.4"] = "lua ~> 5.4",
118 ["5.5"] = "lua ~> 5.5",
113 ["5.1,5.2"] = "lua >= 5.1, < 5.3", 119 ["5.1,5.2"] = "lua >= 5.1, < 5.3",
114 ["5.2,5.3"] = "lua >= 5.2, < 5.4", 120 ["5.2,5.3"] = "lua >= 5.2, < 5.4",
115 ["5.3,5.4"] = "lua >= 5.3, < 5.5", 121 ["5.3,5.4"] = "lua >= 5.3, < 5.5",
122 ["5.4,5.5"] = "lua >= 5.4, < 5.6",
116 ["5.1,5.2,5.3"] = "lua >= 5.1, < 5.4", 123 ["5.1,5.2,5.3"] = "lua >= 5.1, < 5.4",
117 ["5.2,5.3,5.4"] = "lua >= 5.2, < 5.5", 124 ["5.2,5.3,5.4"] = "lua >= 5.2, < 5.5",
125 ["5.3,5.4,5.5"] = "lua >= 5.3, < 5.6",
118 ["5.1,5.2,5.3,5.4"] = "lua >= 5.1, < 5.5", 126 ["5.1,5.2,5.3,5.4"] = "lua >= 5.1, < 5.5",
127 ["5.2,5.3,5.4,5.5"] = "lua >= 5.2, < 5.6",
128 ["5.1,5.2,5.3,5.4,5.5"] = "lua >= 5.1, < 5.6",
119} 129}
120 130
121local simple_scm_protocols = { 131local simple_scm_protocols = {
diff --git a/src/luarocks/core/util.lua b/src/luarocks/core/util.lua
index a6ff0fcb..40ba213d 100644
--- a/src/luarocks/core/util.lua
+++ b/src/luarocks/core/util.lua
@@ -96,7 +96,7 @@ function util.show_table(t, tname, top_indent)
96 else 96 else
97 cart = cart .. " = {\n" 97 cart = cart .. " = {\n"
98 for k, v in pairs(value) do 98 for k, v in pairs(value) do
99 k = basic_serialize(k) 99 local k = basic_serialize(k)
100 local fname = ("%s[%s]"):format(name, k) 100 local fname = ("%s[%s]"):format(name, k)
101 field = ("[%s]"):format(k) 101 field = ("[%s]"):format(k)
102 102
diff --git a/src/luarocks/core/util.tl b/src/luarocks/core/util.tl
index b1bbea05..1a6fefca 100644
--- a/src/luarocks/core/util.tl
+++ b/src/luarocks/core/util.tl
@@ -96,7 +96,7 @@ function util.show_table(t: {any:any}, tname: string, top_indent: string): strin
96 else 96 else
97 cart = cart .. " = {\n" 97 cart = cart .. " = {\n"
98 for k, v in pairs(value) do 98 for k, v in pairs(value) do
99 k = basic_serialize(k) 99 local k = basic_serialize(k)
100 local fname = ("%s[%s]"):format(name, k) 100 local fname = ("%s[%s]"):format(name, k)
101 field = ("[%s]"):format(k) 101 field = ("[%s]"):format(k)
102 -- three spaces between levels 102 -- three spaces between levels
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua
index 13b531f6..90c11bd5 100644
--- a/src/luarocks/deps.lua
+++ b/src/luarocks/deps.lua
@@ -705,15 +705,19 @@ function deps.scan_deps(results, mdeps, name, version, deps_mode)
705end 705end
706 706
707local function lua_h_exists(d, luaver) 707local function lua_h_exists(d, luaver)
708 local major, minor = luaver:match("(%d+)%.(%d+)") 708 local major_s, minor_s = luaver:match("(%d+)%.(%d+)")
709 local luanum = ("%s%02d"):format(major, math.tointeger(minor)) 709 local major, minor = math.tointeger(major_s), math.tointeger(minor_s)
710 710
711 local lua_h = dir.path(d, "lua.h") 711 local lua_h = dir.path(d, "lua.h")
712 local fd = io.open(lua_h) 712 local fd = io.open(lua_h)
713 if fd then 713 if fd then
714 local data = fd:read("*a") 714 local data = fd:read("*a")
715 fd:close() 715 fd:close()
716 if data:match("LUA_VERSION_NUM%s*" .. tostring(luanum)) then 716 if vers.parse_version(("%d.%d"):format(major, minor)) >= vers.parse_version("5.5") then
717 if data:match("LUA_VERSION_MAJOR_N%s+" .. major) and data:match("LUA_VERSION_MINOR_N%s+" .. minor) then
718 return d ~= nil
719 end
720 elseif data:match("LUA_VERSION_NUM%s*" .. ("%d%02d"):format(major, minor)) then
717 return d ~= nil 721 return d ~= nil
718 end 722 end
719 return nil, "Lua header lua.h found at " .. d .. " does not match Lua version " .. luaver .. ". You can use `luarocks config variables.LUA_INCDIR <path>` to set the correct location.", "dependency", 2 723 return nil, "Lua header lua.h found at " .. d .. " does not match Lua version " .. luaver .. ". You can use `luarocks config variables.LUA_INCDIR <path>` to set the correct location.", "dependency", 2
diff --git a/src/luarocks/deps.tl b/src/luarocks/deps.tl
index 98fad54d..55006a95 100644
--- a/src/luarocks/deps.tl
+++ b/src/luarocks/deps.tl
@@ -705,15 +705,19 @@ function deps.scan_deps(results: {string: string}, mdeps: {string: {string: {Que
705end 705end
706 706
707local function lua_h_exists(d: string, luaver: string): boolean, string, string, integer 707local function lua_h_exists(d: string, luaver: string): boolean, string, string, integer
708 local major, minor = luaver:match("(%d+)%.(%d+)") 708 local major_s, minor_s = luaver:match("(%d+)%.(%d+)")
709 local luanum = ("%s%02d"):format(major, math.tointeger(minor)) 709 local major, minor = math.tointeger(major_s), math.tointeger(minor_s)
710 710
711 local lua_h = dir.path(d, "lua.h") 711 local lua_h = dir.path(d, "lua.h")
712 local fd = io.open(lua_h) 712 local fd = io.open(lua_h)
713 if fd then 713 if fd then
714 local data = fd:read("*a") 714 local data = fd:read("*a")
715 fd:close() 715 fd:close()
716 if data:match("LUA_VERSION_NUM%s*" .. tostring(luanum)) then 716 if vers.parse_version(("%d.%d"):format(major, minor)) >= vers.parse_version("5.5") then
717 if data:match("LUA_VERSION_MAJOR_N%s+" .. major) and data:match("LUA_VERSION_MINOR_N%s+" .. minor) then
718 return d ~= nil
719 end
720 elseif data:match("LUA_VERSION_NUM%s*" .. ("%d%02d"):format(major, minor)) then
717 return d ~= nil 721 return d ~= nil
718 end 722 end
719 return nil, "Lua header lua.h found at " .. d .. " does not match Lua version " .. luaver .. ". You can use `luarocks config variables.LUA_INCDIR <path>` to set the correct location.", "dependency", 2 723 return nil, "Lua header lua.h found at " .. d .. " does not match Lua version " .. luaver .. ". You can use `luarocks config variables.LUA_INCDIR <path>` to set the correct location.", "dependency", 2
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index 0f1ee55e..45324c77 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -213,6 +213,7 @@ function fs_lua.modules(at)
213 local path = package.path:sub(-1, -1) == ";" and package.path or package.path .. ";" 213 local path = package.path:sub(-1, -1) == ";" and package.path or package.path .. ";"
214 local paths = {} 214 local paths = {}
215 for location in path:gmatch("(.-);") do 215 for location in path:gmatch("(.-);") do
216 local location = location
216 if location:lower() == "?.lua" then 217 if location:lower() == "?.lua" then
217 location = "./?.lua" 218 location = "./?.lua"
218 end 219 end
diff --git a/src/luarocks/fs/win32/tools.lua b/src/luarocks/fs/win32/tools.lua
index 86cbb45b..56f04b19 100644
--- a/src/luarocks/fs/win32/tools.lua
+++ b/src/luarocks/fs/win32/tools.lua
@@ -131,6 +131,7 @@ function tools.find(at)
131 local pipe = io.popen(fs.command_at(at, fs.quiet_stderr(vars.FIND), true)) 131 local pipe = io.popen(fs.command_at(at, fs.quiet_stderr(vars.FIND), true))
132 for file in pipe:lines() do 132 for file in pipe:lines() do
133 -- Windows find is a bit different 133 -- Windows find is a bit different
134 local file = file
134 local first_two = file:sub(1,2) 135 local first_two = file:sub(1,2)
135 if first_two == ".\\" or first_two == "./" then file=file:sub(3) end 136 if first_two == ".\\" or first_two == "./" then file=file:sub(3) end
136 if file ~= "." then 137 if file ~= "." then
@@ -223,7 +224,7 @@ local function get_system_users()
223 local result = {} 224 local result = {}
224 local fd = assert(io.popen("wmic UserAccount get name")) 225 local fd = assert(io.popen("wmic UserAccount get name"))
225 for user in fd:lines() do 226 for user in fd:lines() do
226 user = user:gsub("%s+$", "") 227 local user = user:gsub("%s+$", "")
227 if not exclude[user] then 228 if not exclude[user] then
228 table.insert(result, user) 229 table.insert(result, user)
229 end 230 end
diff --git a/src/luarocks/tools/patch.lua b/src/luarocks/tools/patch.lua
index d1575cb0..5b00e9b1 100644
--- a/src/luarocks/tools/patch.lua
+++ b/src/luarocks/tools/patch.lua
@@ -188,6 +188,7 @@ function patch.read_patch(filename, data)
188 local lineno = 0 188 local lineno = 0
189 189
190 for line in file_lines(fp) do 190 for line in file_lines(fp) do
191 local line = line
191 lineno = lineno + 1 192 lineno = lineno + 1
192 if state == 'header' then 193 if state == 'header' then
193 if startswith(line, "--- ") then 194 if startswith(line, "--- ") then
diff --git a/src/luarocks/tools/patch.tl b/src/luarocks/tools/patch.tl
index 553964e3..2cfd3841 100644
--- a/src/luarocks/tools/patch.tl
+++ b/src/luarocks/tools/patch.tl
@@ -188,6 +188,7 @@ function patch.read_patch(filename: string, data: string): Files, boolean
188 local lineno = 0 188 local lineno = 0
189 189
190 for line in file_lines(fp) do 190 for line in file_lines(fp) do
191 local line = line
191 lineno = lineno + 1 192 lineno = lineno + 1
192 if state == 'header' then 193 if state == 'header' then
193 if startswith(line, "--- ") then 194 if startswith(line, "--- ") then
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua
index ffa53b09..b35c63ce 100644
--- a/src/luarocks/util.lua
+++ b/src/luarocks/util.lua
@@ -160,7 +160,7 @@ function util.variable_substitutions(tbl, vars)
160end 160end
161 161
162function util.lua_versions(sort) 162function util.lua_versions(sort)
163 local versions = { "5.1", "5.2", "5.3", "5.4" } 163 local versions = { "5.1", "5.2", "5.3", "5.4", "5.5" }
164 local i = 0 164 local i = 0
165 if sort == "descending" then 165 if sort == "descending" then
166 i = #versions + 1 166 i = #versions + 1
@@ -286,7 +286,7 @@ local function collect_rockspecs(versions, paths, unnamed_paths, subdir)
286 local vers = require("luarocks.core.vers") 286 local vers = require("luarocks.core.vers")
287 if fs.is_dir(subdir) then 287 if fs.is_dir(subdir) then
288 for file in fs.dir(subdir) do 288 for file in fs.dir(subdir) do
289 file = dir.path(subdir, file) 289 local file = dir.path(subdir, file)
290 290
291 if file:match("rockspec$") and fs.is_file(file) then 291 if file:match("rockspec$") and fs.is_file(file) then
292 local rock, version = path.parse_name(file) 292 local rock, version = path.parse_name(file)
@@ -550,7 +550,7 @@ function util.get_rocks_provided(rockspec)
550 rocks_provided["bit32"] = lv .. "-1" 550 rocks_provided["bit32"] = lv .. "-1"
551 end 551 end
552 552
553 if lv == "5.3" or lv == "5.4" then 553 if lv == "5.3" or lv == "5.4" or lv == "5.5" then
554 rocks_provided["utf8"] = lv .. "-1" 554 rocks_provided["utf8"] = lv .. "-1"
555 end 555 end
556 556
diff --git a/src/luarocks/util.tl b/src/luarocks/util.tl
index b68883e5..f2fb5a5a 100644
--- a/src/luarocks/util.tl
+++ b/src/luarocks/util.tl
@@ -160,7 +160,7 @@ function util.variable_substitutions<K>(tbl: {K: string}, vars: {string: string}
160end 160end
161 161
162function util.lua_versions(sort?: string): function(): string 162function util.lua_versions(sort?: string): function(): string
163 local versions = { "5.1", "5.2", "5.3", "5.4" } 163 local versions = { "5.1", "5.2", "5.3", "5.4", "5.5" }
164 local i = 0 164 local i = 0
165 if sort == "descending" then 165 if sort == "descending" then
166 i = #versions + 1 166 i = #versions + 1
@@ -286,7 +286,7 @@ local function collect_rockspecs(versions: {string: string}, paths: {string: str
286 local vers = require("luarocks.core.vers") 286 local vers = require("luarocks.core.vers")
287 if fs.is_dir(subdir) then 287 if fs.is_dir(subdir) then
288 for file in fs.dir(subdir) do 288 for file in fs.dir(subdir) do
289 file = dir.path(subdir, file) 289 local file = dir.path(subdir, file)
290 290
291 if file:match("rockspec$") and fs.is_file(file) then 291 if file:match("rockspec$") and fs.is_file(file) then
292 local rock, version = path.parse_name(file) 292 local rock, version = path.parse_name(file)
@@ -550,7 +550,7 @@ function util.get_rocks_provided(rockspec?: Rockspec): {string: string}
550 rocks_provided["bit32"] = lv.."-1" 550 rocks_provided["bit32"] = lv.."-1"
551 end 551 end
552 552
553 if lv == "5.3" or lv == "5.4" then 553 if lv == "5.3" or lv == "5.4" or lv == "5.5" then
554 rocks_provided["utf8"] = lv.."-1" 554 rocks_provided["utf8"] = lv.."-1"
555 end 555 end
556 556