# 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 = "grype" version = "0.111.0" [source] tarball = "https://github.com/anchore/grype/archive/v0.111.0/grype-0.111.0.tar.gz" # FIXME sha256: el wrapper lo calcula (Alpine publica sha512). sha512 de Alpine: # sha512 = "109662075d13ed6b397c3624679b52f49c2713d9bfc5562750ff2892c6f81810f616ffbb218bdfa31a8beae7331b0ff3d446de4cd9f295033afb527e74be1a0f" sha256 = "01d60c3e785f635da8f060712df2a901025386b740eb173e365ae0c263e66792" patches = ["disable-update-check.patch"] [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() { go build -ldflags " -X main.version=0.111.0 " \ -o bin/grype ./cmd/grype ./bin/grype completion bash >grype.bash ./bin/grype completion fish >grype.fish ./bin/grype completion zsh >grype.zsh } _abuild_phase ''' # de package() de Alpine (traducido $pkgdir→/out): install = ''' _abuild_phase() { install -Dm755 bin/grype -t "/out"/usr/bin/ install -Dm644 grype.bash "/out"/usr/share/bash-completion/completions/grype install -Dm644 grype.fish "/out"/usr/share/fish/vendor_completions.d/grype.fish install -Dm644 grype.zsh "/out"/usr/share/zsh/site-functions/_grype } _abuild_phase '''