From 6ac40ff5bb8a96389a5cb408c0501a513f068209 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sat, 10 Dec 2011 02:34:50 -0200 Subject: Isolate all references of "5.1" inside luarocks.cfg --- src/luarocks/build/builtin.lua | 8 ++++---- src/luarocks/cfg.lua | 1 + src/luarocks/deps.lua | 2 +- src/luarocks/path.lua | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index 7b550bff..2a18286f 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua @@ -74,7 +74,7 @@ function run(rockspec) local extras = { unpack(objects) } add_flags(extras, "-L%s", libdirs) add_flags(extras, "%s.lib", libraries) - extras[#extras+1] = dir.path(variables.LUA_LIBDIR, "lua5.1.lib") + extras[#extras+1] = dir.path(variables.LUA_LIBDIR, variables.LUALIB) extras[#extras+1] = "-l" .. (variables.MSVCRT or "msvcr80") local ok = execute(variables.LD.." "..variables.LIBFLAG, "-o", library, unpack(extras)) return ok @@ -89,7 +89,7 @@ function run(rockspec) local ok = execute(variables.RC, "-o", resname, rcname) if not ok then return ok end ok = execute(variables.LD, "-o", wrapname, resname, variables.WRAPPER, - dir.path(variables.LUA_LIBDIR, "lua5.1.lib"), "-l" .. (variables.MSVCRT or "msvcr80"), "-luser32") + dir.path(variables.LUA_LIBDIR, variables.LUALIB), "-l" .. (variables.MSVCRT or "msvcr80"), "-luser32") return ok, wrapname end elseif cfg.is_platform("win32") then @@ -109,7 +109,7 @@ function run(rockspec) def:write("EXPORTS\n") def:write("luaopen_"..name:gsub("%.", "_").."\n") def:close() - local ok = execute(variables.LD, "-dll", "-def:"..deffile, "-out:"..library, dir.path(variables.LUA_LIBDIR, "lua5.1.lib"), unpack(extras)) + local ok = execute(variables.LD, "-dll", "-def:"..deffile, "-out:"..library, dir.path(variables.LUA_LIBDIR, variables.LUALIB), unpack(extras)) local manifestfile = basename..".dll.manifest" if ok and fs.exists(manifestfile) then ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..basename..".dll;2") @@ -126,7 +126,7 @@ function run(rockspec) local ok = execute(variables.RC, "-r", "-fo"..resname, rcname) if not ok then return ok end ok = execute(variables.LD, "-out:"..wrapname, resname, variables.WRAPPER, - dir.path(variables.LUA_LIBDIR, "lua5.1.lib"), "user32.lib") + dir.path(variables.LUA_LIBDIR, variables.LUALIB), "user32.lib") local manifestfile = wrapname..".manifest" if ok and fs.exists(manifestfile) then ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..wrapname..";1") diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index bab74e45..787367f1 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -231,6 +231,7 @@ if detected.windows then defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.obj" defaults.variables.LD = "link" defaults.variables.MT = "mt" + defaults.variables.LUALIB = "lua5.1.lib" defaults.variables.CFLAGS = "/MD /O2" defaults.variables.LIBFLAG = "/dll" defaults.external_deps_patterns = { diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 88a1bb0a..c9155ef5 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua @@ -317,7 +317,7 @@ local function match_dep(dep, blacklist) local versions if dep.name == "lua" then - versions = { "5.1" } + versions = { _VERSION:gsub("Lua ", "") } else versions = manif_core.get_versions(dep.name) end diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index 44e1aa63..585485dd 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua @@ -52,19 +52,19 @@ end function deploy_lua_dir(repo) if type(repo) == "string" then - return dir.path(repo, "share", "lua", "5.1") + return repo..cfg.lua_modules_path else assert(type(repo) == "table") - return repo.lua_dir or dir.path(repo.root, "share", "lua", "5.1") + return repo.lua_dir or repo.root..cfg.lua_modules_path end end function deploy_lib_dir(repo) if type(repo) == "string" then - return dir.path(repo, "lib", "lua", "5.1") + return repo..cfg.lib_modules_path else assert(type(repo) == "table") - return repo.lib_dir or dir.path(repo.root, "lib", "lua", "5.1") + return repo.lib_dir or repo.root..cfg.lib_modules_path end end -- cgit v1.2.3-55-g6feb