internal/rosa: toybox artifact
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m46s
Test / ShareFS (push) Successful in 3m57s
Test / Hpkg (push) Successful in 4m32s
Test / Sandbox (race detector) (push) Successful in 4m56s
Test / Hakurei (race detector) (push) Successful in 5m57s
Test / Hakurei (push) Successful in 2m36s
Test / Flake checks (push) Successful in 1m44s

This compiles surprisingly quickly and required no workarounds, unlike busybox.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-29 04:29:20 +09:00
parent 79c0106ea0
commit 30092d52ed
2 changed files with 40 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ const (
Python
Rsync
Setuptools
Toybox
Wayland
WaylandProtocols
XCB
@@ -126,6 +127,7 @@ func (t Toolchain) ResolveName(name string) (p PArtifact, ok bool) {
"python": Python,
"rsync": Rsync,
"setuptools": Setuptools,
"toybox": Toybox,
"wayland": Wayland,
"wayland-protocols": WaylandProtocols,
"xcb": XCB,

38
internal/rosa/toybox.go Normal file
View File

@@ -0,0 +1,38 @@
package rosa
import "hakurei.app/internal/pkg"
func (t Toolchain) newToybox() pkg.Artifact {
const (
version = "0.8.9"
checksum = "ek4CoKxDsdS2QXuQzXfTn9ADDFjUlY4OtNC-tUiJ6WGxGdtgdLzKG_MzCIaXYcAN"
)
return t.New("toybox-"+version, false, stage3Concat(t, []pkg.Artifact{},
t.Load(Make),
t.Load(Bash),
t.Load(KernelHeaders),
), nil, nil, `
ln -s ../system/bin/bash /bin/ || true
cd /usr/src/toybox
chmod +w kconfig tests
rm \
tests/du.test \
tests/sed.test \
tests/tar.test
export LDFLAGS="${LDFLAGS} -static"
make defconfig
make \
"-j$(nproc)" \
USER=cure \
tests
PREFIX=/work/system/bin make install_flat
`, pkg.Path(AbsUsrSrc.Append("toybox"), true, pkg.NewHTTPGetTar(
nil,
"https://landley.net/toybox/downloads/toybox-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
)))
}
func init() { artifactsF[Toybox] = Toolchain.newToybox }