File size: 800 Bytes
d7c5875 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
local command = { CommandBuild = {} }
local fs = require("luarocks.fs")
local util = require("luarocks.util")
local cfg = require("luarocks.core.cfg")
function command.run(rockspec, not_install)
local build = rockspec.build
util.variable_substitutions(build, rockspec.variables)
local env = {
CC = cfg.variables.CC,
}
if build.build_command then
util.printout(build.build_command)
if not fs.execute_env(env, build.build_command) then
return nil, "Failed building."
end
end
if build.install_command and not not_install then
util.printout(build.install_command)
if not fs.execute_env(env, build.install_command) then
return nil, "Failed installing."
end
end
return true
end
return command
|