diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-21 18:08:00 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-21 18:10:02 +0900 |
| commit | af4c3bbff2d4ef012db945963680f8f764e592ae (patch) | |
| tree | 2ac36029a7f9ae35fde6177ca8b089f9d0047e42 /internal/rosa/package | |
| parent | 54aae9d72a12ae8af93ba35d00a3817e3105dcce (diff) | |
internal/rosa/package: migrate toybox
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/package')
| -rw-r--r-- | internal/rosa/package/toybox.az | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/internal/rosa/package/toybox.az b/internal/rosa/package/toybox.az new file mode 100644 index 00000000..7b1e31cf --- /dev/null +++ b/internal/rosa/package/toybox.az @@ -0,0 +1,134 @@ +package toybox-source { + description = "toybox source tree"; + exclude = true; + + version* = "0.8.13"; + output = remoteTar { + url = "https://landley.net/toybox/downloads/toybox-"+version+".tar.gz"; + checksum = "rZ1V1ATDte2WeQZanxLVoiRGdfPXhMlEo5-exX-e-ml8cGn9qOv0ABEUVZpX3wTI"; + compress = gzip; + }; +} + +package toybox { + description = "many common Linux command line utilities"; + website = "https://landley.net/toybox"; + anitya = 13818; + + source = toybox-source; + + writable = true; + enterSource = true; + toyboxEarly = true; + + exec = make { + omitDefaults = true; + inPlace = true; + skipConfigure = true; + + preMake = ` +LDFLAGS="${LDFLAGS:-''} -static" + +chmod +w /bin/ +ln -rs "$(which bash)" /bin/ || true + +chmod +w kconfig tests +rm \ + tests/du.test \ + tests/sed.test \ + tests/tar.test \ + tests/ls.test \ + tests/taskset.test + +make defconfig +sed -i \ + 's/^CONFIG_TOYBOX_ZHELP=y$/CONFIG_TOYBOX_ZHELP=0/' \ + .config +`; + + check = [ + "USER=cure", + "tests", + ]; + skipEarlyStageCheck = true; + + install = "PREFIX=/work/system/bin make install_flat"; + + postInstall = ` +mkdir -p /work/usr/bin +ln -s ../../system/bin/env /work/usr/bin +`; + }; + + inputs = [ + bash, + gzip, + + kernel-headers, + ]; +} + +package toybox-early { + description = "a build of toybox with unfinished tools enabled to break dependency loops"; + website = "https://landley.net/toybox"; + exclude = true; + + source = toybox-source; + + writable = true; + enterSource = true; + toyboxEarly = true; + + exec = make { + omitDefaults = true; + inPlace = true; + skipConfigure = true; + + preMake = ` +LDFLAGS="${LDFLAGS:-''} -static" + +chmod +w /bin/ +ln -rs "$(which bash)" /bin/ || true + +chmod +w kconfig tests +rm \ + tests/du.test \ + tests/sed.test \ + tests/tar.test \ + tests/ls.test \ + tests/taskset.test + +make defconfig +sed -i \ + 's/^CONFIG_TOYBOX_ZHELP=y$/CONFIG_TOYBOX_ZHELP=0/' \ + .config + +echo ' +CONFIG_EXPR=y +CONFIG_TR=y +CONFIG_AWK=y +CONFIG_DIFF=y +' >> .config +`; + + check = [ + "USER=cure", + "tests", + ]; + skipEarlyStageCheck = true; + + install = "PREFIX=/work/system/bin make install_flat"; + + postInstall = ` +mkdir -p /work/usr/bin +ln -s ../../system/bin/env /work/usr/bin +`; + }; + + inputs = [ + bash, + gzip, + + kernel-headers, + ]; +} |
