aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/cfg.lua5
-rw-r--r--src/luarocks/util.lua2
-rw-r--r--src/luarocks/write_rockspec.lua10
3 files changed, 14 insertions, 3 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
index 21cfbf6d..1207d600 100644
--- a/src/luarocks/cfg.lua
+++ b/src/luarocks/cfg.lua
@@ -483,6 +483,11 @@ if cfg.lua_version >= "5.2" then
483 defaults.rocks_provided["bit32"] = cfg.lua_version.."-1" 483 defaults.rocks_provided["bit32"] = cfg.lua_version.."-1"
484end 484end
485 485
486if cfg.lua_version >= "5.3" then
487 -- Lua 5.3+
488 defaults.rocks_provided["utf8"] = cfg.lua_version.."-1"
489end
490
486if package.loaded.jit then 491if package.loaded.jit then
487 -- LuaJIT 492 -- LuaJIT
488 local lj_version = package.loaded.jit.version:match("LuaJIT (.*)"):gsub("%-","") 493 local lj_version = package.loaded.jit.version:match("LuaJIT (.*)"):gsub("%-","")
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua
index 7e34fe0e..a70e726d 100644
--- a/src/luarocks/util.lua
+++ b/src/luarocks/util.lua
@@ -321,7 +321,7 @@ function util.sortedpairs(tbl, sort_function)
321end 321end
322 322
323function util.lua_versions() 323function util.lua_versions()
324 local versions = { "5.1", "5.2" } 324 local versions = { "5.1", "5.2", "5.3" }
325 local i = 0 325 local i = 0
326 return function() 326 return function()
327 i = i + 1 327 i = i + 1
diff --git a/src/luarocks/write_rockspec.lua b/src/luarocks/write_rockspec.lua
index a194201d..20d35701 100644
--- a/src/luarocks/write_rockspec.lua
+++ b/src/luarocks/write_rockspec.lua
@@ -31,8 +31,8 @@ rockspec, and is not guaranteed to be complete or correct.
31--summary="<txt>" A short one-line description summary. 31--summary="<txt>" A short one-line description summary.
32--description="<txt>" A longer description string. 32--description="<txt>" A longer description string.
33--homepage=<url> Project homepage. 33--homepage=<url> Project homepage.
34--lua-version=<ver> Supported Lua versions. Accepted values are "5.1", "5.2" 34--lua-version=<ver> Supported Lua versions. Accepted values are "5.1", "5.2",
35 or "5.1,5.2". 35 "5.3", "5.1,5.2", "5.2,5.3", or "5.1,5.2,5.3".
36--tag=<tag> Tag to use. Will attempt to extract version number from it. 36--tag=<tag> Tag to use. Will attempt to extract version number from it.
37--lib=<lib>[,<lib>] A comma-separated list of libraries that C files need to 37--lib=<lib>[,<lib>] A comma-separated list of libraries that C files need to
38 link to. 38 link to.
@@ -63,8 +63,14 @@ local function configure_lua_version(rockspec, luaver)
63 table.insert(rockspec.dependencies, "lua ~> 5.1") 63 table.insert(rockspec.dependencies, "lua ~> 5.1")
64 elseif luaver == "5.2" then 64 elseif luaver == "5.2" then
65 table.insert(rockspec.dependencies, "lua ~> 5.2") 65 table.insert(rockspec.dependencies, "lua ~> 5.2")
66 elseif luaver == "5.3" then
67 table.insert(rockspec.dependencies, "lua ~> 5.3")
66 elseif luaver == "5.1,5.2" then 68 elseif luaver == "5.1,5.2" then
67 table.insert(rockspec.dependencies, "lua >= 5.1, < 5.3") 69 table.insert(rockspec.dependencies, "lua >= 5.1, < 5.3")
70 elseif luaver == "5.2,5.3" then
71 table.insert(rockspec.dependencies, "lua >= 5.2, < 5.4")
72 elseif luaver == "5.1,5.2,5.3" then
73 table.insert(rockspec.dependencies, "lua >= 5.1, < 5.4")
68 else 74 else
69 util.warning("Please specify supported Lua version with --lua-version=<ver>. "..util.see_help("write_rockspec")) 75 util.warning("Please specify supported Lua version with --lua-version=<ver>. "..util.see_help("write_rockspec"))
70 end 76 end