pantry/projects/go.dev/package.yml
2022-10-20 10:14:20 -04:00

61 lines
1.1 KiB
YAML

distributable:
url: https://go.dev/dl/go{{ version.raw }}.src.tar.gz
strip-components: 1
versions:
github: golang/go/tags
strip: /^go/
provides:
- bin/go
interprets:
- .go
dependencies:
# `cgo` requires a C compiler
tea.xyz/gx/cc: c99
openssl.org: 1 # for ca-certificates
build:
dependencies:
gnu.org/m4: 1
tea.xyz/gx/make: '*'
tea.xyz/gx/cc: c99
go.dev: '*'
working-directory: src
script: |-
./make.bash
# cleanup
cd ..
rm src/*.{bash,bat,rc}
rm src/Make.dist
rm -rf "{{prefix}}"/*
mv * "{{prefix}}"
find "{{prefix}}" -mindepth 1 -maxdepth 1 -type f -delete -not -name build.sh
env:
GOROOT_FINAL: ${{ prefix }}
GOROOT_BOOTSTRAP: ${{ deps.go.dev.prefix }}
bootstrap:
dependencies:
curl.se: '*'
env:
'*/aarch64': {GOARCH: arm64}
'*/x86-64': {GOARCH: amd64}
script: |
curl -L "$URL" | tar xzf - -C "{{ prefix }}" --strip-components=1
test:
script: |
mv $FIXTURE $FIXTURE.go
OUTPUT=$(go run $FIXTURE.go)
test "Hello World" = "$OUTPUT"
fixture: |
package main
import "fmt"
func main() {
fmt.Println("Hello World")
}