From 094a62ba9d049dfa5b9e6a400020dbc81a789ab4 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 22 Jan 2026 03:00:59 +0900 Subject: internal/rosa: diffutils artifact LLVM tests are not happy with busybox diff. Signed-off-by: Ophestra --- internal/rosa/gnu.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'internal/rosa/gnu.go') diff --git a/internal/rosa/gnu.go b/internal/rosa/gnu.go index c609f68a..1ee76b85 100644 --- a/internal/rosa/gnu.go +++ b/internal/rosa/gnu.go @@ -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, + ))) +} -- cgit v1.3.1