aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2025-03-05 01:27:39 -0300
committerHisham Muhammad <hisham@gobolinux.org>2025-03-10 10:51:05 -0300
commit8230b4d67aa84ae204d9774dd017cedf56faf9ce (patch)
treea7423943af02062fa2c0dbf76609471237f5b260
parent30a2dba8b9748bac34e0fd578b107ab955369125 (diff)
downloadluarocks-8230b4d67aa84ae204d9774dd017cedf56faf9ce.tar.gz
luarocks-8230b4d67aa84ae204d9774dd017cedf56faf9ce.tar.bz2
luarocks-8230b4d67aa84ae204d9774dd017cedf56faf9ce.zip
bootstrap: store .tl filenames when they're generated from .tl
-rwxr-xr-xbootstrap.tl10
1 files changed, 9 insertions, 1 deletions
diff --git a/bootstrap.tl b/bootstrap.tl
index 5017f117..4ea1896c 100755
--- a/bootstrap.tl
+++ b/bootstrap.tl
@@ -218,6 +218,8 @@ local function process_build_entry(data: Data, dep: string, mod: string, modt: s
218 if modt is string then 218 if modt is string then
219 if modt:match("lua$") then 219 if modt:match("lua$") then
220 add_lua(data, dep, mod, "vendor/" .. dep .. "/" .. modt) 220 add_lua(data, dep, mod, "vendor/" .. dep .. "/" .. modt)
221 elseif modt:match("tl$") then
222 -- ignore it
221 else 223 else
222 add_c(data, dep, mod, { sources = { modt } }) 224 add_c(data, dep, mod, { sources = { modt } })
223 end 225 end
@@ -310,6 +312,12 @@ local function generate_all_luas(luas: {Data.LuaEntry})
310 local includes = {} 312 local includes = {}
311 local array = {} 313 local array = {}
312 for _, entry in ipairs(luas) do 314 for _, entry in ipairs(luas) do
315 local source_file = entry.source
316 local tl_file = source_file:gsub("%.lua$", ".tl")
317 if lfs.attributes(tl_file) then
318 source_file = tl_file
319 end
320
313 table.insert(includes, ("#include \"%s\""):format(entry.h_file)) 321 table.insert(includes, ("#include \"%s\""):format(entry.h_file))
314 table.insert(array, apply_template([[ 322 table.insert(array, apply_template([[
315 { 323 {
@@ -321,7 +329,7 @@ local function generate_all_luas(luas: {Data.LuaEntry})
321 ]], { 329 ]], {
322 mod = entry.mod, 330 mod = entry.mod,
323 dep = entry.dep, 331 dep = entry.dep,
324 source = entry.source, 332 source = source_file,
325 length = tostring(entry.length), 333 length = tostring(entry.length),
326 global = global_name(entry.mod), 334 global = global_name(entry.mod),
327 })) 335 }))