Files
zeta-toolchain/toolchain/examples/custom-demo/build.sh
T
huntedbytheirs 159f7bfe83 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
2026-08-07 15:17:47 -04:00

30 lines
1.0 KiB
Bash

#!/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"