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
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
# build.sh — example build.sh-style build script for zeta-makepkg.
#
# Invoked from the extracted source directory. The tool sets:
# $DESTDIR → staging tree root (e.g. /tmp/zeta-makepkg/buildsh-tool-.../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 the project's
# own build.sh — e.g. one that runs configure && make && make install with
# DESTDIR set, or any autotools-like shell build sequence.
set -eu
echo "==> Building buildsh-tool (build.sh)"
# Example: install a shell script into the staging tree
mkdir -p "$DESTDIR/usr/bin"
cat > "$DESTDIR/usr/bin/buildsh-tool" <<'EOF'
#!/bin/sh
echo "buildsh-tool 1.0"
EOF
chmod 755 "$DESTDIR/usr/bin/buildsh-tool"
echo "==> Install complete"
@@ -0,0 +1,23 @@
-- buildsh-demo.recipe — demonstrates build_system = "build.sh".
--
-- The build.sh build system runs the source tree's build.sh script from the
-- extracted source directory. The script receives $DESTDIR pointing at the
-- staging tree where installed files must be placed, exactly like the
-- 'custom' build system — but the script name is fixed to build.sh.
--
-- To try this:
-- 1. Unpack the source tarball: tar -xzf buildsh-tool-1.0.tar.gz
-- 2. Run the script manually: cd buildsh-tool-1.0 && DESTDIR=/tmp/stage sh build.sh
-- 3. Inspect the staged output: find /tmp/stage
-- 4. Build with makepkg: zeta-makepkg buildsh-demo.recipe
return {
name = "buildsh-tool",
version = "1.0",
summary = "Example build.sh-style package (shell-installed binary)",
url = "buildsh-tool-1.0.tar.gz",
sha256 = nil,
deps = {},
build_system = "build.sh",
test = "test -x ${DESTDIR}/usr/bin/buildsh-tool",
}