aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV1K1NGbg <victor@ilchev.com>2024-08-22 17:48:59 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-10-21 13:30:51 -0300
commit9d56fce973f186c09587077f8650f0b24592e8de (patch)
treec0d60b9d422ef6598a191478f23706eac53fa774
parente308cb2fb7a3f960e9289464c46264faec9e6edb (diff)
downloadluarocks-9d56fce973f186c09587077f8650f0b24592e8de.tar.gz
luarocks-9d56fce973f186c09587077f8650f0b24592e8de.tar.bz2
luarocks-9d56fce973f186c09587077f8650f0b24592e8de.zip
Teal: convert luarocks.build.command
-rw-r--r--src/luarocks/build/command.tl (renamed from src/luarocks/build/command.lua)22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/luarocks/build/command.lua b/src/luarocks/build/command.tl
index b0c4aa79..10f8bb94 100644
--- a/src/luarocks/build/command.lua
+++ b/src/luarocks/build/command.tl
@@ -1,23 +1,33 @@
1 1
2local type Build = require("luarocks.core.types.build").Build
3
2--- Build back-end for raw listing of commands in rockspec files. 4--- Build back-end for raw listing of commands in rockspec files.
3local command = {} 5local record command
6 record CommandBuild
7 is Build where self.type == "command"
8
9 build_command: string
10 install_command: string
11 end
12end
4 13
5local fs = require("luarocks.fs") 14local fs = require("luarocks.fs")
6local util = require("luarocks.util") 15local util = require("luarocks.util")
7local cfg = require("luarocks.core.cfg") 16local cfg = require("luarocks.core.cfg")
8 17
18local type Rockspec = require("luarocks.core.types.rockspec").Rockspec
19
9--- Driver function for the "command" build back-end. 20--- Driver function for the "command" build back-end.
10-- @param rockspec table: the loaded rockspec. 21-- @param rockspec table: the loaded rockspec.
11-- @return boolean or (nil, string): true if no errors occurred, 22-- @return boolean or (nil, string): true if no errors occurred,
12-- nil and an error message otherwise. 23-- nil and an error message otherwise.
13function command.run(rockspec, not_install) 24function command.run(rockspec: Rockspec, not_install: boolean): boolean, string, string
14 assert(rockspec:type() == "rockspec")
15 25
16 local build = rockspec.build 26 local build = rockspec.build as command.CommandBuild
17 27
18 util.variable_substitutions(build, rockspec.variables) 28 util.variable_substitutions(build as {string: string}, rockspec.variables)
19 29
20 local env = { 30 local env: {string: string} = {
21 CC = cfg.variables.CC, 31 CC = cfg.variables.CC,
22 --LD = cfg.variables.LD, 32 --LD = cfg.variables.LD,
23 --CFLAGS = cfg.variables.CFLAGS, 33 --CFLAGS = cfg.variables.CFLAGS,