feat: --follow for deps and a custom example

--follow now follows the deptree of the definition
--follow is incompatible with --all
build_system = "custom" example with build.sh
This commit is contained in:
2026-08-07 15:17:47 -04:00
parent a42001b9d8
commit 159f7bfe83
5 changed files with 150 additions and 3 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
# build.sh — example custom build script for zeta-makepkg.
#
# Invoked from the extracted source directory. The tool sets:
# $DESTDIR → staging tree root (e.g. /tmp/zeta-makepkg/mytool-.../stage)
#
# This script must compile/assemble the software and install every output
# file under $DESTDIR with standard FHS paths (usr/bin/, usr/lib/, etc.).
#
# For a real project you would replace the example below with:
# - Go: go build -o "$DESTDIR/usr/bin/mytool" .
# - Rust: cargo build --release && install -D target/release/mytool "$DESTDIR/usr/bin/mytool"
# - Zig: zig build -Doptimize=ReleaseSafe --prefix /usr -Ddestdir="$DESTDIR"
# - Shell: install -D mytool.sh "$DESTDIR/usr/bin/mytool"
# - Python: install -D mytool.py "$DESTDIR/usr/bin/mytool"
# - Anything you can script.
set -eu
echo "==> Building mytool (custom)"
# Standalone Go binary: init module, build, install
go mod init mytool
go build -o mytool .
# Install into the staging tree
install -Dm755 mytool "$DESTDIR/usr/bin/mytool"
echo "==> Install complete"
@@ -0,0 +1,23 @@
-- custom.recipe — demonstrates build_system = "custom" with a build.sh script.
--
-- The custom build system runs `build_script` from inside the extracted
-- source directory. The script receives $DESTDIR pointing at the staging
-- tree where installed files must be placed.
--
-- To try this:
-- 1. Unpack the source tarball: tar -xzf mytool-1.0.tar.gz
-- 2. Run the script manually: cd mytool-1.0 && DESTDIR=/tmp/stage sh build.sh
-- 3. Inspect the staged output: find /tmp/stage
-- 4. Build with makepkg: zeta-makepkg custom.recipe
return {
name = "mytool",
version = "1.0",
summary = "Example custom-build package (static Go binary)",
url = "mytool-1.0.tar.gz",
sha256 = nil,
deps = {},
build_system = "custom",
build_script = "build.sh",
test = "test -x ${DESTDIR}/usr/bin/mytool",
}