# 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    = "cargo-chef"
version = "0.1.77"

[source]
tarball = "https://github.com/LukeMathWalker/cargo-chef/archive/refs/tags/v0.1.77.tar.gz"
# FIXME sha256: el wrapper lo calcula (Alpine publica sha512). sha512 de Alpine:
# sha512 = "53ef5b1afd6c8f8c72ed1d55c8a18f4650a1226a520e55286d2ec1ff71cdb4a644dba4a8d068ba933d04c06adfa280fd553afad05024c2118813c2990f35fa8d"
sha256  = "829376cedccde0d6dcf242ca22234d8996e64f51c8033cc1dae4819e6b0a27fb"

[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 auditable build --release --frozen
}
_abuild_phase
'''
# de package() de Alpine (traducido $pkgdir→/out):
install = '''
_abuild_phase() {
install -Dm755 target/release/cargo-chef -t "/out"/usr/bin/

	install -Dm 644 README.md -t "/out"/usr/share/doc/"cargo-chef"/
	install -Dm 644 LICENSE-MIT -t "/out"/usr/share/licenses/"cargo-chef"/
	install -Dm 644 LICENSE-APACHE -t "/out"/usr/share/licenses/"cargo-chef"/
}
_abuild_phase
'''
