diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2011-12-10 16:33:16 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2011-12-10 16:33:16 -0200 |
commit | 483e4442cae6efcbd55b7dd63ade802f7c6b2b0b (patch) | |
tree | 8e300f2cd00d027376052e40fbc2e2878e5800db | |
parent | bb0c49c9f14f69cdbae3558e10f271dfbda6d182 (diff) | |
download | luarocks-483e4442cae6efcbd55b7dd63ade802f7c6b2b0b.tar.gz luarocks-483e4442cae6efcbd55b7dd63ade802f7c6b2b0b.tar.bz2 luarocks-483e4442cae6efcbd55b7dd63ade802f7c6b2b0b.zip |
isolate all references of "5.1" to luarocks.cfg
-rw-r--r-- | src/luarocks/build/builtin.lua | 8 | ||||
-rw-r--r-- | src/luarocks/cfg.lua | 1 | ||||
-rw-r--r-- | src/luarocks/deps.lua | 2 | ||||
-rw-r--r-- | 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) | |||
74 | local extras = { unpack(objects) } | 74 | local extras = { unpack(objects) } |
75 | add_flags(extras, "-L%s", libdirs) | 75 | add_flags(extras, "-L%s", libdirs) |
76 | add_flags(extras, "%s.lib", libraries) | 76 | add_flags(extras, "%s.lib", libraries) |
77 | extras[#extras+1] = dir.path(variables.LUA_LIBDIR, "lua5.1.lib") | 77 | extras[#extras+1] = dir.path(variables.LUA_LIBDIR, variables.LUALIB) |
78 | extras[#extras+1] = "-l" .. (variables.MSVCRT or "msvcr80") | 78 | extras[#extras+1] = "-l" .. (variables.MSVCRT or "msvcr80") |
79 | local ok = execute(variables.LD.." "..variables.LIBFLAG, "-o", library, unpack(extras)) | 79 | local ok = execute(variables.LD.." "..variables.LIBFLAG, "-o", library, unpack(extras)) |
80 | return ok | 80 | return ok |
@@ -89,7 +89,7 @@ function run(rockspec) | |||
89 | local ok = execute(variables.RC, "-o", resname, rcname) | 89 | local ok = execute(variables.RC, "-o", resname, rcname) |
90 | if not ok then return ok end | 90 | if not ok then return ok end |
91 | ok = execute(variables.LD, "-o", wrapname, resname, variables.WRAPPER, | 91 | ok = execute(variables.LD, "-o", wrapname, resname, variables.WRAPPER, |
92 | dir.path(variables.LUA_LIBDIR, "lua5.1.lib"), "-l" .. (variables.MSVCRT or "msvcr80"), "-luser32") | 92 | dir.path(variables.LUA_LIBDIR, variables.LUALIB), "-l" .. (variables.MSVCRT or "msvcr80"), "-luser32") |
93 | return ok, wrapname | 93 | return ok, wrapname |
94 | end | 94 | end |
95 | elseif cfg.is_platform("win32") then | 95 | elseif cfg.is_platform("win32") then |
@@ -109,7 +109,7 @@ function run(rockspec) | |||
109 | def:write("EXPORTS\n") | 109 | def:write("EXPORTS\n") |
110 | def:write("luaopen_"..name:gsub("%.", "_").."\n") | 110 | def:write("luaopen_"..name:gsub("%.", "_").."\n") |
111 | def:close() | 111 | def:close() |
112 | local ok = execute(variables.LD, "-dll", "-def:"..deffile, "-out:"..library, dir.path(variables.LUA_LIBDIR, "lua5.1.lib"), unpack(extras)) | 112 | local ok = execute(variables.LD, "-dll", "-def:"..deffile, "-out:"..library, dir.path(variables.LUA_LIBDIR, variables.LUALIB), unpack(extras)) |
113 | local manifestfile = basename..".dll.manifest" | 113 | local manifestfile = basename..".dll.manifest" |
114 | if ok and fs.exists(manifestfile) then | 114 | if ok and fs.exists(manifestfile) then |
115 | ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..basename..".dll;2") | 115 | ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..basename..".dll;2") |
@@ -126,7 +126,7 @@ function run(rockspec) | |||
126 | local ok = execute(variables.RC, "-r", "-fo"..resname, rcname) | 126 | local ok = execute(variables.RC, "-r", "-fo"..resname, rcname) |
127 | if not ok then return ok end | 127 | if not ok then return ok end |
128 | ok = execute(variables.LD, "-out:"..wrapname, resname, variables.WRAPPER, | 128 | ok = execute(variables.LD, "-out:"..wrapname, resname, variables.WRAPPER, |
129 | dir.path(variables.LUA_LIBDIR, "lua5.1.lib"), "user32.lib") | 129 | dir.path(variables.LUA_LIBDIR, variables.LUALIB), "user32.lib") |
130 | local manifestfile = wrapname..".manifest" | 130 | local manifestfile = wrapname..".manifest" |
131 | if ok and fs.exists(manifestfile) then | 131 | if ok and fs.exists(manifestfile) then |
132 | ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..wrapname..";1") | 132 | ok = execute(variables.MT, "-manifest", manifestfile, "-outputresource:"..wrapname..";1") |
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index bab74e45..5f9952bb 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -233,6 +233,7 @@ if detected.windows then | |||
233 | defaults.variables.MT = "mt" | 233 | defaults.variables.MT = "mt" |
234 | defaults.variables.CFLAGS = "/MD /O2" | 234 | defaults.variables.CFLAGS = "/MD /O2" |
235 | defaults.variables.LIBFLAG = "/dll" | 235 | defaults.variables.LIBFLAG = "/dll" |
236 | defaults.variables.LUALIB = "lua5.1.lib" | ||
236 | defaults.external_deps_patterns = { | 237 | defaults.external_deps_patterns = { |
237 | bin = { "?.exe", "?.bat" }, | 238 | bin = { "?.exe", "?.bat" }, |
238 | lib = { "?.lib", "?.dll", "lib?.dll" }, | 239 | lib = { "?.lib", "?.dll", "lib?.dll" }, |
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 88a1bb0a..227ce9f8 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -317,7 +317,7 @@ local function match_dep(dep, blacklist) | |||
317 | 317 | ||
318 | local versions | 318 | local versions |
319 | if dep.name == "lua" then | 319 | if dep.name == "lua" then |
320 | versions = { "5.1" } | 320 | versions = { (_VERSION:gsub("Lua ", "")) } |
321 | else | 321 | else |
322 | versions = manif_core.get_versions(dep.name) | 322 | versions = manif_core.get_versions(dep.name) |
323 | end | 323 | end |
diff --git a/src/luarocks/path.lua b/src/luarocks/path.lua index 44e1aa63..9b7f6bc7 100644 --- a/src/luarocks/path.lua +++ b/src/luarocks/path.lua | |||
@@ -52,19 +52,19 @@ end | |||
52 | 52 | ||
53 | function deploy_lua_dir(repo) | 53 | function deploy_lua_dir(repo) |
54 | if type(repo) == "string" then | 54 | if type(repo) == "string" then |
55 | return dir.path(repo, "share", "lua", "5.1") | 55 | return dir.path(repo, cfg.lua_modules_path) |
56 | else | 56 | else |
57 | assert(type(repo) == "table") | 57 | assert(type(repo) == "table") |
58 | return repo.lua_dir or dir.path(repo.root, "share", "lua", "5.1") | 58 | return repo.lua_dir or dir.path(repo.root, cfg.lua_modules_path) |
59 | end | 59 | end |
60 | end | 60 | end |
61 | 61 | ||
62 | function deploy_lib_dir(repo) | 62 | function deploy_lib_dir(repo) |
63 | if type(repo) == "string" then | 63 | if type(repo) == "string" then |
64 | return dir.path(repo, "lib", "lua", "5.1") | 64 | return dir.path(repo, cfg.lib_modules_path) |
65 | else | 65 | else |
66 | assert(type(repo) == "table") | 66 | assert(type(repo) == "table") |
67 | return repo.lib_dir or dir.path(repo.root, "lib", "lua", "5.1") | 67 | return repo.lib_dir or dir.path(repo.root, cfg.lib_modules_path) |
68 | end | 68 | end |
69 | end | 69 | end |
70 | 70 | ||