diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2013-09-07 01:13:01 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2013-09-07 01:13:01 -0300 |
commit | fabfd9c06fa81fa470f8b93873e61ff632109c8c (patch) | |
tree | 79b51a3ac1f7c239a3411aa1c436cc6514417cce | |
parent | 268efd3f76ebb4a0c0ff155bdb33b76d807a0784 (diff) | |
download | luarocks-fabfd9c06fa81fa470f8b93873e61ff632109c8c.tar.gz luarocks-fabfd9c06fa81fa470f8b93873e61ff632109c8c.tar.bz2 luarocks-fabfd9c06fa81fa470f8b93873e61ff632109c8c.zip |
Call helper binaries using full path on Windows. Closes #127. Closes #140.
-rw-r--r-- | src/luarocks/cfg.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 9508ce88..54b52a66 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -31,6 +31,7 @@ end | |||
31 | _M.site_config = site_config | 31 | _M.site_config = site_config |
32 | 32 | ||
33 | program_version = "2.1.0" | 33 | program_version = "2.1.0" |
34 | major_version = program_version:match("([^.]%.[^.])" | ||
34 | 35 | ||
35 | local persist = require("luarocks.persist") | 36 | local persist = require("luarocks.persist") |
36 | 37 | ||
@@ -265,6 +266,8 @@ local defaults = { | |||
265 | } | 266 | } |
266 | 267 | ||
267 | if detected.windows then | 268 | if detected.windows then |
269 | local full_prefix = site_config.LUAROCKS_PREFIX.."\\"..major_version | ||
270 | |||
268 | home_config_file = home_config_file and home_config_file:gsub("\\","/") | 271 | home_config_file = home_config_file and home_config_file:gsub("\\","/") |
269 | defaults.fs_use_modules = false | 272 | defaults.fs_use_modules = false |
270 | defaults.arch = "win32-"..proc | 273 | defaults.arch = "win32-"..proc |
@@ -281,13 +284,22 @@ if detected.windows then | |||
281 | defaults.variables.MAKE = "nmake" | 284 | defaults.variables.MAKE = "nmake" |
282 | defaults.variables.CC = "cl" | 285 | defaults.variables.CC = "cl" |
283 | defaults.variables.RC = "rc" | 286 | defaults.variables.RC = "rc" |
284 | defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.c" | 287 | defaults.variables.WRAPPER = full_prefix.."\\rclauncher.c" |
285 | defaults.variables.LD = "link" | 288 | defaults.variables.LD = "link" |
286 | defaults.variables.MT = "mt" | 289 | defaults.variables.MT = "mt" |
287 | defaults.variables.LUALIB = "lua"..lua_version..".lib" | 290 | defaults.variables.LUALIB = "lua"..lua_version..".lib" |
288 | defaults.variables.CFLAGS = "/MD /O2" | 291 | defaults.variables.CFLAGS = "/MD /O2" |
289 | defaults.variables.LIBFLAG = "/dll" | 292 | defaults.variables.LIBFLAG = "/dll" |
290 | defaults.variables.LUALIB = "lua"..lua_version..".lib" | 293 | defaults.variables.LUALIB = "lua"..lua_version..".lib" |
294 | |||
295 | local bins = { "SEVENZ", "CHMOD", "CP", "FIND", "LS", "MD5SUM", | ||
296 | "MKDIR", "MV", "PWD", "RMDIR", "RM", "TEST", "UNAME", "WGET" } | ||
297 | for _, var in ipairs(bins) do | ||
298 | if defaults.variables[var] then | ||
299 | defaults.variables[var] = full_prefix.."\\"..defaults.variables[var] | ||
300 | end | ||
301 | end | ||
302 | |||
291 | defaults.external_deps_patterns = { | 303 | defaults.external_deps_patterns = { |
292 | bin = { "?.exe", "?.bat" }, | 304 | bin = { "?.exe", "?.bat" }, |
293 | lib = { "?.lib", "?.dll", "lib?.dll" }, | 305 | lib = { "?.lib", "?.dll", "lib?.dll" }, |
@@ -312,7 +324,6 @@ if detected.mingw32 then | |||
312 | defaults.variables.MAKE = "mingw32-make" | 324 | defaults.variables.MAKE = "mingw32-make" |
313 | defaults.variables.CC = "mingw32-gcc" | 325 | defaults.variables.CC = "mingw32-gcc" |
314 | defaults.variables.RC = "windres" | 326 | defaults.variables.RC = "windres" |
315 | defaults.variables.WRAPPER = site_config.LUAROCKS_PREFIX .. "\\2.0\\rclauncher.c" | ||
316 | defaults.variables.LD = "mingw32-gcc" | 327 | defaults.variables.LD = "mingw32-gcc" |
317 | defaults.variables.CFLAGS = "-O2" | 328 | defaults.variables.CFLAGS = "-O2" |
318 | defaults.variables.LIBFLAG = "-shared" | 329 | defaults.variables.LIBFLAG = "-shared" |