aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-22 05:42:23 +0900
committerOphestra <cat@gensokyo.uk>2026-01-22 05:42:23 +0900
commit50b82dcf8265a4fe00e9856759553c26dfc43f58 (patch)
treed3b153b3e7eb77278643bd7277184c9410c4a7b1
parent20a8d30821e8f33f77acf28d0b6935adbb05e6a1 (diff)
internal/rosa/gnu: coreutils artifact
Required by llvm unit and regression tests. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/rosa/gnu.go34
-rw-r--r--internal/rosa/llvm.go1
2 files changed, 32 insertions, 3 deletions
diff --git a/internal/rosa/gnu.go b/internal/rosa/gnu.go
index b2087187..5d0b917a 100644
--- a/internal/rosa/gnu.go
+++ b/internal/rosa/gnu.go
@@ -149,9 +149,6 @@ func (t Toolchain) NewBash() pkg.Artifact {
return t.New("bash-"+version, []pkg.Artifact{
t.NewMake(),
}, nil, nil, `
-cd /usr/src/bash
-test_disable() { chmod +w "$2" && echo "$1" > "$2"; }
-
cd "$(mktemp -d)"
/usr/src/bash/configure \
--prefix=/system \
@@ -166,3 +163,34 @@ make DESTDIR=/work install
pkg.TarGzip,
)))
}
+
+// NewCoreutils returns a [pkg.Artifact] containing an installation of GNU Coreutils.
+func (t Toolchain) NewCoreutils() pkg.Artifact {
+ const (
+ version = "9.9"
+ checksum = "B1_TaXj1j5aiVIcazLWu8Ix03wDV54uo2_iBry4qHG6Y-9bjDpUPlkNLmU_3Nvw6"
+ )
+ return t.New("coreutils-"+version, []pkg.Artifact{
+ t.NewMake(),
+ t.NewPerl(),
+
+ t.NewKernelHeaders(),
+ }, nil, nil, `
+cd /usr/src/coreutils
+test_disable() { chmod +w "$2" && echo "$1" > "$2"; }
+
+test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh
+
+cd "$(mktemp -d)"
+/usr/src/coreutils/configure \
+ --prefix=/system \
+ --build="${ROSA_TRIPLE}"
+make "-j$(nproc)" check
+make DESTDIR=/work install
+`, pkg.Path(AbsUsrSrc.Append("coreutils"), true, pkg.NewHTTPGetTar(
+ nil,
+ "https://ftp.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz",
+ mustDecode(checksum),
+ pkg.TarGzip,
+ )))
+}
diff --git a/internal/rosa/llvm.go b/internal/rosa/llvm.go
index fd31d4b0..ecb383d4 100644
--- a/internal/rosa/llvm.go
+++ b/internal/rosa/llvm.go
@@ -130,6 +130,7 @@ func (t Toolchain) newLLVM(variant string, attr *llvmAttr) pkg.Artifact {
t.NewPerl(),
t.NewDiffutils(),
t.NewBash(),
+ t.NewCoreutils(),
t.NewKernelHeaders(),
}