gunk-dev/the-valley

valley-darwin-build.sh

sourcecaaa5bee5e11main's published tip history
783 bytes
1# shellcheck shell=bash
2# One client program's build phase for darwin/arm64 (darwin.nix). GOOS,
3# GOARCH and CGO_ENABLED come from the derivation, and so do targets, the
4# package's build targets. They are linked, so a symbol Darwin lacks fails
5# here as it would on a Mac. go vet runs over every package of this
6# repository they are built from: those of the main module and of the
7# modules it replaces with their directories beside it. The vetted
8# packages are kept for the output.
9# shellcheck disable=SC2154,SC2086 # targets and vetted are lists of packages
10mkdir -p "$TMPDIR/bin"
11go build -o "$TMPDIR/bin/" $targets
12vetted="$(go list -deps -f '{{with .Module}}{{if or .Main .Replace}}{{$.ImportPath}}{{end}}{{end}}' $targets)"
13go vet $vetted
14echo "$vetted" > "$TMPDIR/vetted"