# samurai 1.3 — clon C de ninja (lo que usa Alpine como `ninja`). Build-tool del stack meson
# (libdrm/wayland/mesa lo invocan como backend). Provee /usr/bin/samu + symlink /usr/bin/ninja.
# zig 0.13.0: con el zig default (0.16/clang21) el binario musl miscompila y falla en runtime
# con "reallocarray: No error information" — el patrón conocido (binutils/elfutils/flex).
name    = "samurai"
version = "1.3"

[source]
tarball = "https://github.com/michaelforney/samurai/releases/download/1.3/samurai-1.3.tar.gz"
sha256  = "1bc020a9e133432df51911ac71cc34322f828934d9a2282ba2916d88c15976af"

[build]
compiler    = "zig-cc"
target      = "x86_64-linux-musl"
link        = "static"
zig_version = "0.13.0"

[build.phases]
compile = 'make CFLAGS="-O2"'
install = '''
set -e
make install PREFIX="/usr" DESTDIR="/out"
ln -s samu /out/usr/bin/ninja
'''
