abinfo "Building and installing ..."
ZIG_FLAGS=(
    "--verbose"
    "--summary" "all"
    "--prefix" "/usr"
    "--system" "$SRCDIR/offline-cache/p"
    "-Doptimize=ReleaseFast"
    "-Dcpu=baseline"
    "-Dversion-string=$PKGVER"
)

# FIXME: Pandoc only support amd64 and arm64 architectures
if ! { ab_match_arch amd64 || ab_match_arch arm64; }; then
    abinfo "Disabling documentation generation for non-supported architecture"
    ZIG_FLAGS+=("-Demit-docs=false")
fi

DESTDIR="$PKGDIR" zig build "${ZIG_FLAGS[@]}"
