diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-17 13:07:12 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-17 15:56:53 +0900 |
| commit | 30eb0d6a613ad268f6805ccbcdcabf158e7f526f (patch) | |
| tree | 07e55baa52748fd139e183017eeb43f5f64cee59 /internal/rosa/toybox.go | |
| parent | c2ff9c9fa55ea569a5e70ee90d2eb0b2ee2a0540 (diff) | |
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/toybox.go')
| -rw-r--r-- | internal/rosa/toybox.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/rosa/toybox.go b/internal/rosa/toybox.go index 7a86fb80..d5e12380 100644 --- a/internal/rosa/toybox.go +++ b/internal/rosa/toybox.go @@ -2,12 +2,12 @@ package rosa import "hakurei.app/internal/pkg" -func (t Toolchain) newToybox(suffix, script string) (pkg.Artifact, string) { +func (s *S) newToybox(t Toolchain, suffix, script string) (pkg.Artifact, string) { const ( version = "0.8.13" checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI" ) - return t.NewPackage("toybox"+suffix, version, newTar( + return s.NewPackage(t, "toybox"+suffix, version, newTar( "https://landley.net/toybox/downloads/toybox-"+version+".tar.gz", checksum, pkg.TarGzip, @@ -59,9 +59,9 @@ ln -s ../../system/bin/env /work/usr/bin ), version } func init() { - artifactsM[Toybox] = Metadata{ - f: func(t Toolchain) (pkg.Artifact, string) { - return t.newToybox("", "") + native.MustRegister(&Artifact{ + f: func(t Toolchain, s *S) (pkg.Artifact, string) { + return s.newToybox(t, "", "") }, Name: "toybox", @@ -69,11 +69,11 @@ func init() { Website: "https://landley.net/toybox/", ID: 13818, - } + }) - artifactsM[toyboxEarly] = Metadata{ - f: func(t Toolchain) (pkg.Artifact, string) { - return t.newToybox("-early", ` + native.MustRegister(&Artifact{ + f: func(t Toolchain, s *S) (pkg.Artifact, string) { + return s.newToybox(t, "-early", ` echo ' CONFIG_EXPR=y CONFIG_TR=y @@ -86,5 +86,5 @@ CONFIG_DIFF=y Name: "toybox-early", Description: "a build of toybox with unfinished tools enabled to break dependency loops", Website: "https://landley.net/toybox/", - } + }) } |
