diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-05-25 13:22:14 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-05-25 13:22:14 -0300 |
| commit | 09496341c97961dc0c8d07632ef8bf026e6f390f (patch) | |
| tree | c4ff3069b79a1b37be10c81df9bba054b1cb5314 | |
| parent | 42992d6504d6cd111f000dd3aae912f18510e8e2 (diff) | |
| parent | 2478fb2d24aa8a5fc02debb24dbd2cd2c844cc94 (diff) | |
| download | luarocks-09496341c97961dc0c8d07632ef8bf026e6f390f.tar.gz luarocks-09496341c97961dc0c8d07632ef8bf026e6f390f.tar.bz2 luarocks-09496341c97961dc0c8d07632ef8bf026e6f390f.zip | |
Merge branch 'Zash-lua54'
| -rwxr-xr-x | configure | 13 | ||||
| -rw-r--r-- | install.bat | 10 | ||||
| -rw-r--r-- | src/luarocks/cmd/write_rockspec.lua | 13 | ||||
| -rw-r--r-- | src/luarocks/core/cfg.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/util.lua | 2 |
5 files changed, 26 insertions, 14 deletions
| @@ -39,7 +39,7 @@ system's package manager. | |||
| 39 | --rocks-tree=DIR Root of the local tree of installed rocks. | 39 | --rocks-tree=DIR Root of the local tree of installed rocks. |
| 40 | Default is \$PREFIX | 40 | Default is \$PREFIX |
| 41 | 41 | ||
| 42 | --lua-version=VERSION Use specific Lua version: 5.1, 5.2, or 5.3 | 42 | --lua-version=VERSION Use specific Lua version: 5.1, 5.2, 5.3, or 5.4 |
| 43 | Default is auto-detected. | 43 | Default is auto-detected. |
| 44 | --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames. | 44 | --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames. |
| 45 | Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...) | 45 | Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...) |
| @@ -163,7 +163,7 @@ do | |||
| 163 | --lua-version|--with-lua-version) | 163 | --lua-version|--with-lua-version) |
| 164 | [ -n "$value" ] || die "Missing value in flag $key." | 164 | [ -n "$value" ] || die "Missing value in flag $key." |
| 165 | LUA_VERSION="$value" | 165 | LUA_VERSION="$value" |
| 166 | [ "$LUA_VERSION" = "5.1" -o "$LUA_VERSION" = "5.2" -o "$LUA_VERSION" = "5.3" ] || die "Invalid Lua version in flag $key." | 166 | [ "$LUA_VERSION" = "5.1" -o "$LUA_VERSION" = "5.2" -o "$LUA_VERSION" = "5.3" -o "$LUA_VERSION" = "5.4" ] || die "Invalid Lua version in flag $key." |
| 167 | LUA_VERSION_SET=yes | 167 | LUA_VERSION_SET=yes |
| 168 | ;; | 168 | ;; |
| 169 | --with-lua) | 169 | --with-lua) |
| @@ -224,7 +224,7 @@ then | |||
| 224 | fi | 224 | fi |
| 225 | 225 | ||
| 226 | detect_lua_version() { | 226 | detect_lua_version() { |
| 227 | detected_lua=`$1 -e 'print(_VERSION:match(" (5%.[123])$"))' 2> /dev/null` | 227 | detected_lua=`$1 -e 'print(_VERSION:match(" (5%.[1234])$"))' 2> /dev/null` |
| 228 | if [ "$detected_lua" != "nil" ] | 228 | if [ "$detected_lua" != "nil" ] |
| 229 | then | 229 | then |
| 230 | if [ "$LUA_VERSION_SET" != "yes" ] | 230 | if [ "$LUA_VERSION_SET" != "yes" ] |
| @@ -286,9 +286,12 @@ then | |||
| 286 | suffixes="5.2 52 -5.2 -52" | 286 | suffixes="5.2 52 -5.2 -52" |
| 287 | elif [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.3" ] | 287 | elif [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.3" ] |
| 288 | then | 288 | then |
| 289 | suffixes="5.4 54 -5.4 -54" | ||
| 290 | elif [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.4" ] | ||
| 291 | then | ||
| 289 | suffixes="5.3 53 -5.3 -53" | 292 | suffixes="5.3 53 -5.3 -53" |
| 290 | else | 293 | else |
| 291 | suffixes="5.3 53 -5.3 -53 5.2 52 -5.2 -52 5.1 51 -5.1 -51" | 294 | suffixes="5.4 54 -5.4 -54 5.3 53 -5.3 -53 5.2 52 -5.2 -52 5.1 51 -5.1 -51" |
| 292 | fi | 295 | fi |
| 293 | for suffix in `echo $suffixes` "" | 296 | for suffix in `echo $suffixes` "" |
| 294 | do | 297 | do |
| @@ -400,7 +403,7 @@ else | |||
| 400 | die "Could not determine processor architecture. 'uname -m' failed." | 403 | die "Could not determine processor architecture. 'uname -m' failed." |
| 401 | fi | 404 | fi |
| 402 | 405 | ||
| 403 | for v in 5.1 5.2 5.3; do | 406 | for v in 5.1 5.2 5.3 5.4; do |
| 404 | if [ "$v" != "$LUA_VERSION" ]; then | 407 | if [ "$v" != "$LUA_VERSION" ]; then |
| 405 | if [ -e "$PREFIX/share/lua/$v/luarocks/site_config.lua" ]; then | 408 | if [ -e "$PREFIX/share/lua/$v/luarocks/site_config.lua" ]; then |
| 406 | LUA_OTHER_VERSION="$v" | 409 | LUA_OTHER_VERSION="$v" |
diff --git a/install.bat b/install.bat index 09cf9aa2..0ca8639f 100644 --- a/install.bat +++ b/install.bat | |||
| @@ -127,7 +127,7 @@ Configuring the destinations: | |||
| 127 | if you create a self contained installation. | 127 | if you create a self contained installation. |
| 128 | 128 | ||
| 129 | Configuring the Lua interpreter: | 129 | Configuring the Lua interpreter: |
| 130 | /LV [version] Lua version to use; either 5.1, 5.2, or 5.3. | 130 | /LV [version] Lua version to use; either 5.1, 5.2, 5.3, or 5.4. |
| 131 | Default is auto-detected. | 131 | Default is auto-detected. |
| 132 | /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ | 132 | /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ |
| 133 | If not provided, the installer will search the system | 133 | If not provided, the installer will search the system |
| @@ -250,8 +250,8 @@ local function check_flags() | |||
| 250 | die("Bundled Lua version is 5.1, cannot install "..vars.LUA_VERSION) | 250 | die("Bundled Lua version is 5.1, cannot install "..vars.LUA_VERSION) |
| 251 | end | 251 | end |
| 252 | end | 252 | end |
| 253 | if not vars.LUA_VERSION:match("^5%.[123]$") then | 253 | if not vars.LUA_VERSION:match("^5%.[1234]$") then |
| 254 | die("Bad argument: /LV must either be 5.1, 5.2, or 5.3") | 254 | die("Bad argument: /LV must either be 5.1, 5.2, 5.3, or 5.4") |
| 255 | end | 255 | end |
| 256 | if USE_MSVC_MANUAL and USE_MINGW then | 256 | if USE_MSVC_MANUAL and USE_MINGW then |
| 257 | die("Cannot combine option /MSVC and /MW") | 257 | die("Cannot combine option /MSVC and /MW") |
| @@ -269,7 +269,7 @@ local function detect_lua_version(interpreter_path) | |||
| 269 | local full_version = handler:read("*a") | 269 | local full_version = handler:read("*a") |
| 270 | handler:close() | 270 | handler:close() |
| 271 | 271 | ||
| 272 | local version = full_version:match(" (5%.[123])$") | 272 | local version = full_version:match(" (5%.[1234])$") |
| 273 | if not version then | 273 | if not version then |
| 274 | return nil, "unknown interpreter version '" .. full_version .. "'" | 274 | return nil, "unknown interpreter version '" .. full_version .. "'" |
| 275 | end | 275 | end |
| @@ -281,7 +281,7 @@ local function look_for_interpreter(directory) | |||
| 281 | if lua_version_set then | 281 | if lua_version_set then |
| 282 | names = {S"lua$LUA_VERSION.exe", S"lua$LUA_SHORTV.exe"} | 282 | names = {S"lua$LUA_VERSION.exe", S"lua$LUA_SHORTV.exe"} |
| 283 | else | 283 | else |
| 284 | names = {"lua5.3.exe", "lua53.exe", "lua5.2.exe", "lua52.exe", "lua5.1.exe", "lua51.exe"} | 284 | names = {"lua5.4.exe", "lua54.exe", "lua5.3.exe", "lua53.exe", "lua5.2.exe", "lua52.exe", "lua5.1.exe", "lua51.exe"} |
| 285 | end | 285 | end |
| 286 | table.insert(names, "lua.exe") | 286 | table.insert(names, "lua.exe") |
| 287 | table.insert(names, "luajit.exe") | 287 | table.insert(names, "luajit.exe") |
diff --git a/src/luarocks/cmd/write_rockspec.lua b/src/luarocks/cmd/write_rockspec.lua index 88223857..53be404c 100644 --- a/src/luarocks/cmd/write_rockspec.lua +++ b/src/luarocks/cmd/write_rockspec.lua | |||
| @@ -33,8 +33,9 @@ rockspec, and is not guaranteed to be complete or correct. | |||
| 33 | --summary="<txt>" A short one-line description summary. | 33 | --summary="<txt>" A short one-line description summary. |
| 34 | --detailed="<txt>" A longer description string. | 34 | --detailed="<txt>" A longer description string. |
| 35 | --homepage=<url> Project homepage. | 35 | --homepage=<url> Project homepage. |
| 36 | --lua-version=<ver> Supported Lua versions. Accepted values are "5.1", "5.2", | 36 | --lua-version=<ver> Supported Lua versions. Accepted values are: "5.1", "5.2", |
| 37 | "5.3", "5.1,5.2", "5.2,5.3", or "5.1,5.2,5.3". | 37 | "5.3", "5.4", "5.1,5.2", "5.2,5.3", "5.3,5.4", "5.1,5.2,5.3", |
| 38 | "5.2,5.3,5.4", or "5.1,5.2,5.3,5.4" | ||
| 38 | --rockspec-format=<ver> Rockspec format version, such as "1.0" or "1.1". | 39 | --rockspec-format=<ver> Rockspec format version, such as "1.0" or "1.1". |
| 39 | --tag=<tag> Tag to use. Will attempt to extract version number from it. | 40 | --tag=<tag> Tag to use. Will attempt to extract version number from it. |
| 40 | --lib=<lib>[,<lib>] A comma-separated list of libraries that C files need to | 41 | --lib=<lib>[,<lib>] A comma-separated list of libraries that C files need to |
| @@ -68,12 +69,20 @@ local function configure_lua_version(rockspec, luaver) | |||
| 68 | table.insert(rockspec.dependencies, "lua ~> 5.2") | 69 | table.insert(rockspec.dependencies, "lua ~> 5.2") |
| 69 | elseif luaver == "5.3" then | 70 | elseif luaver == "5.3" then |
| 70 | table.insert(rockspec.dependencies, "lua ~> 5.3") | 71 | table.insert(rockspec.dependencies, "lua ~> 5.3") |
| 72 | elseif luaver == "5.4" then | ||
| 73 | table.insert(rockspec.dependencies, "lua ~> 5.4") | ||
| 71 | elseif luaver == "5.1,5.2" then | 74 | elseif luaver == "5.1,5.2" then |
| 72 | table.insert(rockspec.dependencies, "lua >= 5.1, < 5.3") | 75 | table.insert(rockspec.dependencies, "lua >= 5.1, < 5.3") |
| 73 | elseif luaver == "5.2,5.3" then | 76 | elseif luaver == "5.2,5.3" then |
| 74 | table.insert(rockspec.dependencies, "lua >= 5.2, < 5.4") | 77 | table.insert(rockspec.dependencies, "lua >= 5.2, < 5.4") |
| 78 | elseif luaver == "5.3,5.4" then | ||
| 79 | table.insert(rockspec.dependencies, "lua >= 5.3, < 5.5") | ||
| 75 | elseif luaver == "5.1,5.2,5.3" then | 80 | elseif luaver == "5.1,5.2,5.3" then |
| 76 | table.insert(rockspec.dependencies, "lua >= 5.1, < 5.4") | 81 | table.insert(rockspec.dependencies, "lua >= 5.1, < 5.4") |
| 82 | elseif luaver == "5.2,5.3,5.4" then | ||
| 83 | table.insert(rockspec.dependencies, "lua >= 5.2, < 5.5") | ||
| 84 | elseif luaver == "5.1,5.2,5.3,5.4" then | ||
| 85 | table.insert(rockspec.dependencies, "lua >= 5.1, < 5.5") | ||
| 77 | else | 86 | else |
| 78 | util.warning("Please specify supported Lua version with --lua-version=<ver>. "..util.see_help("write_rockspec")) | 87 | util.warning("Please specify supported Lua version with --lua-version=<ver>. "..util.see_help("write_rockspec")) |
| 79 | end | 88 | end |
diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index f036aa44..834dba79 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua | |||
| @@ -15,7 +15,7 @@ local rawset, next, table, pairs, require, io, os, setmetatable, pcall, ipairs, | |||
| 15 | 15 | ||
| 16 | local cfg = {} | 16 | local cfg = {} |
| 17 | 17 | ||
| 18 | cfg.lua_version = _VERSION:match(" (5%.[123])$") or "5.1" | 18 | cfg.lua_version = _VERSION:match(" (5%.[1234])$") or "5.1" |
| 19 | local version_suffix = cfg.lua_version:gsub("%.", "_") | 19 | local version_suffix = cfg.lua_version:gsub("%.", "_") |
| 20 | 20 | ||
| 21 | -- Load site-local global configurations | 21 | -- Load site-local global configurations |
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua index 7fdefce0..ff36aa50 100644 --- a/src/luarocks/util.lua +++ b/src/luarocks/util.lua | |||
| @@ -310,7 +310,7 @@ function util.variable_substitutions(tbl, vars) | |||
| 310 | end | 310 | end |
| 311 | 311 | ||
| 312 | function util.lua_versions() | 312 | function util.lua_versions() |
| 313 | local versions = { "5.1", "5.2", "5.3" } | 313 | local versions = { "5.1", "5.2", "5.3", "5.4" } |
| 314 | local i = 0 | 314 | local i = 0 |
| 315 | return function() | 315 | return function() |
| 316 | i = i + 1 | 316 | i = i + 1 |
