internal/rosa: diffutils artifact
All checks were successful
Test / Create distribution (push) Successful in 1m46s
Test / Sandbox (push) Successful in 6m1s
Test / Hakurei (push) Successful in 8m2s
Test / Sandbox (race detector) (push) Successful in 8m22s
Test / ShareFS (push) Successful in 8m31s
Test / Hpkg (push) Successful in 8m37s
Test / Hakurei (race detector) (push) Successful in 3m24s
Test / Flake checks (push) Successful in 1m46s

LLVM tests are not happy with busybox diff.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-22 03:00:59 +09:00
parent 6420b6e6e8
commit 094a62ba9d
2 changed files with 31 additions and 0 deletions

View File

@@ -110,3 +110,32 @@ make DESTDIR=/work install
pkg.TarGzip,
)))
}
// NewDiffutils returns a [pkg.Artifact] containing an installation of GNU diffutils.
func (t Toolchain) NewDiffutils() pkg.Artifact {
const (
version = "3.12"
checksum = "9J5VAq5oA7eqwzS1Yvw-l3G5o-TccUrNQR3PvyB_lgdryOFAfxtvQfKfhdpquE44"
)
return t.New("diffutils-"+version, []pkg.Artifact{
t.NewMake(),
}, nil, nil, `
cd /usr/src/diffutils
test_disable() { chmod +w "$2" && echo "$1" > "$2"; }
test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh
test_disable 'int main(){return 0;}' gnulib-tests/test-c32ispunct.c
cd "$(mktemp -d)"
/usr/src/diffutils/configure \
--prefix=/system \
--build="${ROSA_TRIPLE}"
make "-j$(nproc)" check
make DESTDIR=/work install
`, pkg.Path(AbsUsrSrc.Append("diffutils"), true, pkg.NewHTTPGetTar(
nil,
"https://ftp.gnu.org/gnu/diffutils/diffutils-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
)))
}

View File

@@ -127,6 +127,8 @@ func (t Toolchain) newLLVM(variant string, attr *llvmAttr) pkg.Artifact {
extra := []pkg.Artifact{
t.NewLibffi(),
t.NewPython(),
t.NewPerl(),
t.NewDiffutils(),
t.NewKernelHeaders(),
}
if t == toolchainStage3 {