add: zig and build.sh

build systems
This commit is contained in:
2026-08-23 16:48:51 -04:00
parent 4c701854f9
commit 0b3ebd0f7a
7 changed files with 84 additions and 6 deletions
+11 -1
View File
@@ -3,7 +3,7 @@
-- Handles the full build pipeline for a recipe:
-- 1. fetch_source — download to cache (or detect git)
-- 2. extract_source — unpack tarball or clone git repo
-- 3. run_build — dispatch autotools/cmake/meson/make/cargo/custom
-- 3. run_build — dispatch autotools/cmake/meson/make/cargo/zig/build.sh/custom
-- 4. run_test — execute post-build verification command
--
-- All subprocesses run in a minimal environment. Build tools (meson, cmake,
@@ -298,6 +298,16 @@ function builder.run_build(recipe, source_dir, stage_dir, opts)
end
run("install -D " .. path.quote(target) .. " " .. path.quote(path.join(bin_dir, path.basename(target))))
elseif bs == "zig" then
run("zig build -Doptimize=ReleaseSafe" .. args_str)
run("zig build install --prefix /usr -Ddestdir=" .. path.quote(stage_dir))
elseif bs == "build.sh" then
if not path.exists(path.join(source_dir, "build.sh")) then
error(("no build.sh script found in %s (build_system is 'build.sh')"):format(source_dir), 0)
end
run("DESTDIR=" .. path.quote(stage_dir) .. " sh build.sh")
elseif bs == "custom" then
local script = recipe.build_script
run("DESTDIR=" .. path.quote(stage_dir) .. " sh " .. path.quote(script))