# Importada de Alpine aports por `hammer import-alpine` (Etapa G). PUNTO DE PARTIDA — pero
# YA trae los parches de musl de Alpine (lo que un import de nix pierde). Pendiente: el
# sha256 del tarball (el wrapper lo calcula), y adaptar build/install del shell de abuild.
name    = "tuc"
version = "1.3.0"

[source]
tarball = "https://github.com/riquito/tuc/archive/v1.3.0/tuc-1.3.0.tar.gz"
# FIXME sha256: el wrapper lo calcula (Alpine publica sha512). sha512 de Alpine:
# sha512 = "da64cffa388d032576b1f96f13d20c1ee657cd99eba0d1b0252dcc133bcd5b2de49007a30c426760d845dbd5ddf23ab7b81ebb83bce4eba7f40d25712f539ddf"
sha256  = "81dc5f4a0355ecdf9515c88c34c365d20f339d316df7dbe72667cd2b18445c61"

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

[build.phases]
# de build() de Alpine (traducido; el lab provee $CBUILD/$CHOST — Etapa G Fase 3; revisá --shared para estático):
compile = '''
_abuild_phase() {
cargo build --frozen --release
}
_abuild_phase
'''
# de package() de Alpine (traducido $pkgdir→/out):
install = '''
_abuild_phase() {
install -Dm755 target/release/tuc -t "/out"/usr/bin/
}
_abuild_phase
'''
