Files
hakurei/internal/rosa/all.go
Ophestra 5c9ac71cee
Some checks failed
Test / Create distribution (push) Successful in 49s
Test / Sandbox (push) Successful in 2m37s
Test / Flake checks (push) Has been cancelled
Test / Hpkg (push) Has started running
Test / Hakurei (push) Has been cancelled
Test / Sandbox (race detector) (push) Has been cancelled
Test / Hakurei (race detector) (push) Has been cancelled
Test / ShareFS (push) Has been cancelled
internal/rosa: setuptools artifact
Apparently the only way to install python stuff offline.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-26 02:23:03 +09:00

56 lines
997 B
Go

package rosa
import (
"sync"
"hakurei.app/internal/pkg"
)
// PArtifact is a lazily-initialised [pkg.Artifact] preset.
type PArtifact int
const (
Autoconf PArtifact = iota
Bash
Busybox
CMake
Coreutils
Diffutils
Gettext
Git
Go
KernelHeaders
Libffi
M4
Make
Ninja
Patch
Perl
PkgConfig
Python
Rsync
Setuptools
Zlib
// _presetEnd is the total number of presets and does not denote a preset.
_presetEnd
)
var (
// artifactsF is an array of functions for the result of [PArtifact].
artifactsF [_presetEnd]func(t Toolchain) pkg.Artifact
// artifacts stores the result of artifactsF.
artifacts [_toolchainEnd][len(artifactsF)]pkg.Artifact
// artifactsOnce is for lazy initialisation of artifacts.
artifactsOnce [_toolchainEnd][len(artifactsF)]sync.Once
)
// Load returns the resulting [pkg.Artifact] of [PArtifact].
func (t Toolchain) Load(p PArtifact) pkg.Artifact {
artifactsOnce[t][p].Do(func() {
artifacts[t][p] = artifactsF[p](t)
})
return artifacts[t][p]
}