/
pkg.yaml
40 lines (36 loc) · 1.2 KB
/
pkg.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: golang
dependencies:
- stage: base
- stage: '{{ if eq .ARCH "aarch64" }}golang-alpine{{ else }}golang-bootstrap{{ end }}'
steps:
- sources:
- url: https://dl.google.com/go/go1.17.1.src.tar.gz
destination: go.src.tar.gz
sha256: 49dc08339770acd5613312db8c141eaf61779995577b89d93b541ef83067e5b1
sha512: 23d4e003651204c5bcc5cf41437134e07a3fe3c188eb129f2d6366a7445a7919d6a7319c57483e91b3415fd28aa55df8d58eec398434f20ce6accd587925a14b
env:
GOROOT_BOOTSTRAP: '{{ .TOOLCHAIN }}/go_bootstrap'
GOROOT_FINAL: '{{ .TOOLCHAIN }}/go'
CGO_ENABLED: '0'
prepare:
- tar -xzf go.src.tar.gz --strip-components=1
build:
- cd src && sh make.bash
install:
- rm -rf pkg/obj
- rm -rf pkg/bootstrap
- rm -f pkg/tool/*/api
- |
find src \( -type f -a -name "*_test.go" \) \
-exec rm -rf \{\} \+
- |
find src \( -type d -a -name "testdata" \) \
-exec rm -rf \{\} \+
- |
find src -type f -a \( -name "*.bash" -o -name "*.rc" -o -name "*.bat" \) \
-exec rm -rf \{\} \+
- mkdir -p "/rootfs${GOROOT_FINAL}"
- mv * "/rootfs${GOROOT_FINAL}"
finalize:
- from: /rootfs
to: /