internal/rosa/make: migrate to helper interface

This also updates all affected artifacts to use new behaviour.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-03-01 23:54:40 +09:00
parent 9deaf853f0
commit cc60e0d15d
41 changed files with 698 additions and 740 deletions

View File

@@ -7,24 +7,27 @@ func (t Toolchain) newToybox(suffix, script string) pkg.Artifact {
version = "0.8.13"
checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI"
)
return t.NewViaMake("toybox"+suffix, version, pkg.NewHTTPGetTar(
nil,
"https://landley.net/toybox/downloads/toybox-"+version+".tar.gz",
return t.NewPackage("toybox"+suffix, version, pkg.NewHTTPGetTar(
nil, "https://landley.net/toybox/downloads/toybox-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
Writable: true,
), &PackageAttr{
// uses source tree as scratch space
Writable: true,
EnterSource: true,
Flag: TEarly,
}, &MakeHelper{
OmitDefaults: true,
InPlace: true,
SkipConfigure: true,
ScriptEarly: `
ScriptMakeEarly: `
LDFLAGS="${LDFLAGS:-''} -static"
chmod +w /bin/
ln -rs "$(which bash)" /bin/ || true
cd /usr/src/toybox` + suffix + `
chmod +w kconfig tests
rm \
tests/du.test \
@@ -37,25 +40,22 @@ make defconfig
sed -i \
's/^CONFIG_TOYBOX_ZHELP=y$/CONFIG_TOYBOX_ZHELP=0/' \
.config
`,
ScriptConfigured: script,
SkipCheck: t.isStage0(),
` + script,
SkipCheck: t.isStage0(),
Check: []string{
"USER=cure",
"tests",
},
ScriptInstall: "PREFIX=/work/system/bin make install_flat",
Install: "PREFIX=/work/system/bin make install_flat",
Script: `
mkdir -p /work/usr/bin
ln -s ../../system/bin/env /work/usr/bin
`,
Flag: TEarly,
},
t.Load(Bash),
t.Load(Gzip),
Bash,
Gzip,
t.Load(KernelHeaders),
KernelHeaders,
)
}
func init() {