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>
This commit is contained in:
2026-05-17 13:07:12 +09:00
parent c2ff9c9fa5
commit 30eb0d6a61
95 changed files with 1514 additions and 1567 deletions

View File

@@ -8,12 +8,12 @@ import (
"hakurei.app/internal/pkg"
)
func (t Toolchain) newCMake() (pkg.Artifact, string) {
func (t Toolchain) newCMake(s *S) (pkg.Artifact, string) {
const (
version = "4.3.2"
checksum = "6QylwRVKletndTSkZTV2YBRwgd_9rUVgav_QW23HpjUgV21AVYZOUOal8tdBDmO7"
)
return t.NewPackage("cmake", version, newFromGitHubRelease(
return s.NewPackage(t, "cmake", version, newFromGitHubRelease(
"Kitware/CMake",
"v"+version,
"cmake-"+version+".tar.gz",
@@ -106,7 +106,7 @@ index 2ead810437..f85cbb8b1c 100644
), version
}
func init() {
artifactsM[CMake] = Metadata{
native.MustRegister(&Artifact{
f: Toolchain.newCMake,
Name: "cmake",
@@ -114,7 +114,7 @@ func init() {
Website: "https://cmake.org/",
ID: 306,
}
})
}
// CMakeHelper is the [CMake] build system helper.
@@ -164,7 +164,7 @@ func (*CMakeHelper) createDir() bool { return true }
func (*CMakeHelper) wantsDir() string { return "/cure/" }
// script generates the cure script.
func (attr *CMakeHelper) script(name string) string {
func (attr *CMakeHelper) script(s *S, name string) string {
if attr == nil {
attr = new(CMakeHelper)
}
@@ -180,7 +180,7 @@ func (attr *CMakeHelper) script(name string) string {
}
script := attr.Script
if !attr.SkipTest && presetOpts&OptSkipCheck == 0 {
if !attr.SkipTest && s.opts&OptSkipCheck == 0 {
script += "\n" + test
}