diff options
| author | V1K1NGbg <victor@ilchev.com> | 2024-08-22 17:48:59 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-08-22 17:48:59 -0300 |
| commit | fd3909d9178b0da065f5cca85c3f225f89d18d4e (patch) | |
| tree | bc156a73bbba200448e1089e0e10b660857fea8b /src | |
| parent | 8f9d7c407baad51f7a5e077211071e4180f2ab59 (diff) | |
| download | luarocks-fd3909d9178b0da065f5cca85c3f225f89d18d4e.tar.gz luarocks-fd3909d9178b0da065f5cca85c3f225f89d18d4e.tar.bz2 luarocks-fd3909d9178b0da065f5cca85c3f225f89d18d4e.zip | |
Teal: convert luarocks.build.command
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/build/command.tl (renamed from src/luarocks/build/command.lua) | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/luarocks/build/command.lua b/src/luarocks/build/command.tl index b0c4aa79..baadf01b 100644 --- a/src/luarocks/build/command.lua +++ b/src/luarocks/build/command.tl | |||
| @@ -1,23 +1,27 @@ | |||
| 1 | 1 | ||
| 2 | --- Build back-end for raw listing of commands in rockspec files. | 2 | --- Build back-end for raw listing of commands in rockspec files. |
| 3 | local command = {} | 3 | local record command |
| 4 | end | ||
| 4 | 5 | ||
| 5 | local fs = require("luarocks.fs") | 6 | local fs = require("luarocks.fs") |
| 6 | local util = require("luarocks.util") | 7 | local util = require("luarocks.util") |
| 7 | local cfg = require("luarocks.core.cfg") | 8 | local cfg = require("luarocks.core.cfg") |
| 8 | 9 | ||
| 10 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec | ||
| 11 | |||
| 12 | local type CommandBuild = require("luarocks.core.types.build").CommandBuild | ||
| 13 | |||
| 9 | --- Driver function for the "command" build back-end. | 14 | --- Driver function for the "command" build back-end. |
| 10 | -- @param rockspec table: the loaded rockspec. | 15 | -- @param rockspec table: the loaded rockspec. |
| 11 | -- @return boolean or (nil, string): true if no errors occurred, | 16 | -- @return boolean or (nil, string): true if no errors occurred, |
| 12 | -- nil and an error message otherwise. | 17 | -- nil and an error message otherwise. |
| 13 | function command.run(rockspec, not_install) | 18 | function command.run(rockspec: Rockspec, not_install: boolean): boolean, string, string |
| 14 | assert(rockspec:type() == "rockspec") | ||
| 15 | 19 | ||
| 16 | local build = rockspec.build | 20 | local build = rockspec.build as CommandBuild |
| 17 | 21 | ||
| 18 | util.variable_substitutions(build, rockspec.variables) | 22 | util.variable_substitutions(build as {string: string}, rockspec.variables) |
| 19 | 23 | ||
| 20 | local env = { | 24 | local env: {string: string} = { |
| 21 | CC = cfg.variables.CC, | 25 | CC = cfg.variables.CC, |
| 22 | --LD = cfg.variables.LD, | 26 | --LD = cfg.variables.LD, |
| 23 | --CFLAGS = cfg.variables.CFLAGS, | 27 | --CFLAGS = cfg.variables.CFLAGS, |
