diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-24 19:13:40 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 15:51:36 -0300 |
commit | 1c2fe8bad11a343c63e658cf43dcbf30c930eec5 (patch) | |
tree | 3eff97268ec6c9e593b8d2b1f723d789d9854ec7 | |
parent | 9b0c5b56d39e5a405804ea477a5210fdba378e00 (diff) | |
download | luarocks-1c2fe8bad11a343c63e658cf43dcbf30c930eec5.tar.gz luarocks-1c2fe8bad11a343c63e658cf43dcbf30c930eec5.tar.bz2 luarocks-1c2fe8bad11a343c63e658cf43dcbf30c930eec5.zip |
command: auto-export some standard variables
-rw-r--r-- | src/luarocks/build/command.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/luarocks/build/command.lua b/src/luarocks/build/command.lua index 23d6d80d..2a581a39 100644 --- a/src/luarocks/build/command.lua +++ b/src/luarocks/build/command.lua | |||
@@ -4,6 +4,7 @@ local command = {} | |||
4 | 4 | ||
5 | local fs = require("luarocks.fs") | 5 | local fs = require("luarocks.fs") |
6 | local util = require("luarocks.util") | 6 | local util = require("luarocks.util") |
7 | local cfg = require("luarocks.core.cfg") | ||
7 | 8 | ||
8 | --- Driver function for the "command" build back-end. | 9 | --- Driver function for the "command" build back-end. |
9 | -- @param rockspec table: the loaded rockspec. | 10 | -- @param rockspec table: the loaded rockspec. |
@@ -15,16 +16,22 @@ function command.run(rockspec) | |||
15 | local build = rockspec.build | 16 | local build = rockspec.build |
16 | 17 | ||
17 | util.variable_substitutions(build, rockspec.variables) | 18 | util.variable_substitutions(build, rockspec.variables) |
18 | 19 | ||
20 | local env = { | ||
21 | CC = cfg.variables.CC, | ||
22 | LD = cfg.variables.LD, | ||
23 | CFLAGS = cfg.variables.CFLAGS, | ||
24 | } | ||
25 | |||
19 | if build.build_command then | 26 | if build.build_command then |
20 | util.printout(build.build_command) | 27 | util.printout(build.build_command) |
21 | if not fs.execute(build.build_command) then | 28 | if not fs.execute_env(env, build.build_command) then |
22 | return nil, "Failed building." | 29 | return nil, "Failed building." |
23 | end | 30 | end |
24 | end | 31 | end |
25 | if build.install_command then | 32 | if build.install_command then |
26 | util.printout(build.install_command) | 33 | util.printout(build.install_command) |
27 | if not fs.execute(build.install_command) then | 34 | if not fs.execute_env(env, build.install_command) then |
28 | return nil, "Failed installing." | 35 | return nil, "Failed installing." |
29 | end | 36 | end |
30 | end | 37 | end |