aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/tamago.go
blob: 3433542350fd7a926e2d058f93314b43fc19c5aa (plain)
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
41
42
43
44
45
46
47
48
49
50
51
package rosa

import (
	"runtime"

	"hakurei.app/internal/pkg"
)

func (t Toolchain) newTamaGo() (pkg.Artifact, string) {
	const (
		version  = "1.26.1"
		checksum = "fimZnklQcYWGsTQU8KepLn-yCYaTfNdMI9DCg6NJVQv-3gOJnUEO9mqRCMAHnEXZ"
	)
	return t.New("tamago-go"+version, 0, t.AppendPresets(nil,
		Bash,
		Go,
	), nil, []string{
		"CC=cc",
		"GOCACHE=/tmp/gocache",
		"CGO_ENABLED=0",
	}, `
mkdir /work/system # "${TMPDIR}"
cp -r /usr/src/tamago /work/system
cd /work/system/tamago/src
chmod -R +w ..

sed -i \
	's,/lib/ld-musl-`+linuxArch()+`.so.1,/system/bin/linker,' \
	cmd/link/internal/`+runtime.GOARCH+`/obj.go
rm \
	os/root_unix_test.go

./all.bash
`, pkg.Path(AbsUsrSrc.Append("tamago"), false, pkg.NewHTTPGetTar(
		nil, "https://github.com/usbarmory/tamago-go/archive/refs/tags/"+
			"tamago-go"+version+".tar.gz",
		mustDecode(checksum),
		pkg.TarGzip,
	))), version
}
func init() {
	artifactsM[TamaGo] = Metadata{
		f: Toolchain.newTamaGo,

		Name:        "tamago",
		Description: "a Go toolchain extended with support for bare metal execution",
		Website:     "https://github.com/usbarmory/tamago-go",

		ID: 388872,
	}
}