aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--Makefile.install.inc2
-rw-r--r--install.bat31
-rw-r--r--src/luarocks/build.lua14
-rw-r--r--src/luarocks/download.lua2
-rw-r--r--src/luarocks/remove.lua2
6 files changed, 35 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 81d24d24..dc9079b0 100644
--- a/Makefile
+++ b/Makefile
@@ -92,7 +92,7 @@ build_bins: cleanup_bins
92 echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\ 92 echo "#!$(LUA_BINDIR)/lua$(LUA_SUFFIX)" > src/bin/$$f ;\
93 echo "package.path = [[$(LUADIR)/?.lua;]]..package.path" | sed "s,//,/,g" >> src/bin/$$f ;\ 93 echo "package.path = [[$(LUADIR)/?.lua;]]..package.path" | sed "s,//,/,g" >> src/bin/$$f ;\
94 cat src/bin/$$f.bak >> src/bin/$$f ;\ 94 cat src/bin/$$f.bak >> src/bin/$$f ;\
95 chmod +x src/bin/$$f ;\ 95 chmod +rx src/bin/$$f ;\
96 rm -f src/bin/$$f.bak ;\ 96 rm -f src/bin/$$f.bak ;\
97 done 97 done
98 98
@@ -117,7 +117,7 @@ cleanup_bins:
117 do \ 117 do \
118 mv src/bin/$$f src/bin/$$f.bak ;\ 118 mv src/bin/$$f src/bin/$$f.bak ;\
119 sed "s,^#!.*lua.*,#!/usr/bin/env lua,;/^package.path/d" < src/bin/$$f.bak > src/bin/$$f ;\ 119 sed "s,^#!.*lua.*,#!/usr/bin/env lua,;/^package.path/d" < src/bin/$$f.bak > src/bin/$$f ;\
120 chmod +x src/bin/$$f ;\ 120 chmod +rx src/bin/$$f ;\
121 rm -f src/bin/$$f.bak ;\ 121 rm -f src/bin/$$f.bak ;\
122 done 122 done
123 123
diff --git a/Makefile.install.inc b/Makefile.install.inc
index 02d40735..621d7cb2 100644
--- a/Makefile.install.inc
+++ b/Makefile.install.inc
@@ -8,7 +8,7 @@ install_bins:
8 for f in $(BIN_FILES); \ 8 for f in $(BIN_FILES); \
9 do \ 9 do \
10 cp "$$f" "$(DESTDIR)$(BINDIR)/$$f-$$luaver"; \ 10 cp "$$f" "$(DESTDIR)$(BINDIR)/$$f-$$luaver"; \
11 chmod +x "$(DESTDIR)$(BINDIR)/$$f-$$luaver"; \ 11 chmod +rx "$(DESTDIR)$(BINDIR)/$$f-$$luaver"; \
12 ln -nfs "$$f-$$luaver" "$(DESTDIR)$(BINDIR)/$$f"; \ 12 ln -nfs "$$f-$$luaver" "$(DESTDIR)$(BINDIR)/$$f"; \
13 done 13 done
14 14
diff --git a/install.bat b/install.bat
index df058585..dcd132ff 100644
--- a/install.bat
+++ b/install.bat
@@ -508,17 +508,30 @@ local function get_msvc_env_setup_cmd()
508 -- 1. try visual studio command line tools 508 -- 1. try visual studio command line tools
509 local vcdir = get_visual_studio_directory() 509 local vcdir = get_visual_studio_directory()
510 if vcdir then 510 if vcdir then
511 -- 1.1. try vcvarsall.bat 511 local vcvars_bats = {
512 local vcvarsall = vcdir .. 'vcvarsall.bat' 512 x86 = {
513 if exists(vcvarsall) then 513 "bin\\vcvars32.bat", -- prefers native compiler
514 return ('call "%s"%s'):format(vcvarsall, x64 and ' amd64' or '') 514 "bin\\amd64_x86\\vcvarsamd64_x86.bat"-- then cross compiler
515 },
516 x86_64 = {
517 "bin\\amd64\\vcvars64.bat", -- prefers native compiler
518 "bin\\x86_amd64\\vcvarsx86_amd64.bat" -- then cross compiler
519 }
520 }
521 assert(vcvars_bats[vars.UNAME_M], "vars.UNAME_M: only x86 and x86_64 are supported")
522 for _, bat in ipairs(vcvars_bats[vars.UNAME_M]) do
523 local full_path = vcdir .. bat
524 if exists(full_path) then
525 return ('call "%s"'):format(full_path)
526 end
515 end 527 end
516 528
517 -- 1.2. try vcvars32.bat / vcvars64.bat 529 -- try vcvarsall.bat in case MS changes the undocumented bat files above.
518 local relative_path = x64 and "bin\\amd64\\vcvars64.bat" or "bin\\vcvars32.bat" 530 -- but this way we don't konw if specified compiler is installed...
519 local full_path = vcdir .. relative_path 531 local vcvarsall = vcdir .. 'vcvarsall.bat'
520 if exists(full_path) then 532 if exists(vcvarsall) then
521 return ('call "%s"'):format(full_path) 533 local vcvarsall_args = { x86 = "", x86_64 = " amd64" }
534 return ('call "%s"%s'):format(vcvarsall, vcvarsall_args[vars.UNAME_M])
522 end 535 end
523 end 536 end
524 537
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua
index 0e72ca85..5722deca 100644
--- a/src/luarocks/build.lua
+++ b/src/luarocks/build.lua
@@ -177,6 +177,14 @@ function build.build_rockspec(rockspec_file, need_to_fetch, minimal_mode, deps_m
177 return nil, "Rockspec error: build type not specified" 177 return nil, "Rockspec error: build type not specified"
178 end 178 end
179 179
180 if not build_only_deps then
181 local ok
182 ok, err, errcode = deps.check_external_deps(rockspec, "build")
183 if err then
184 return nil, err, errcode
185 end
186 end
187
180 if deps_mode == "none" then 188 if deps_mode == "none" then
181 util.printerr("Warning: skipping dependency checks.") 189 util.printerr("Warning: skipping dependency checks.")
182 else 190 else
@@ -193,12 +201,6 @@ function build.build_rockspec(rockspec_file, need_to_fetch, minimal_mode, deps_m
193 return name, version 201 return name, version
194 end 202 end
195 203
196 local ok
197 ok, err, errcode = deps.check_external_deps(rockspec, "build")
198 if err then
199 return nil, err, errcode
200 end
201
202 if repos.is_installed(name, version) then 204 if repos.is_installed(name, version) then
203 repos.delete_version(name, version) 205 repos.delete_version(name, version)
204 end 206 end
diff --git a/src/luarocks/download.lua b/src/luarocks/download.lua
index 2e434b03..18573ae4 100644
--- a/src/luarocks/download.lua
+++ b/src/luarocks/download.lua
@@ -88,7 +88,7 @@ end
88function download.command(flags, name, version) 88function download.command(flags, name, version)
89 assert(type(version) == "string" or not version) 89 assert(type(version) == "string" or not version)
90 if type(name) ~= "string" and not flags["all"] then 90 if type(name) ~= "string" and not flags["all"] then
91 return nil, "Argument missing, see help." 91 return nil, "Argument missing. "..util.see_help("download")
92 end 92 end
93 if not name then name, version = "", "" end 93 if not name then name, version = "", "" end
94 94
diff --git a/src/luarocks/remove.lua b/src/luarocks/remove.lua
index 38851d36..d72fabaf 100644
--- a/src/luarocks/remove.lua
+++ b/src/luarocks/remove.lua
@@ -139,7 +139,7 @@ end
139-- successful, nil and an error message otherwise. exitcode is optionally returned. 139-- successful, nil and an error message otherwise. exitcode is optionally returned.
140function remove.command(flags, name, version) 140function remove.command(flags, name, version)
141 if type(name) ~= "string" then 141 if type(name) ~= "string" then
142 return nil, "Argument missing, see help." 142 return nil, "Argument missing. "..util.see_help("remove")
143 end 143 end
144 144
145 local deps_mode = flags["deps-mode"] or cfg.deps_mode 145 local deps_mode = flags["deps-mode"] or cfg.deps_mode