diff --git a/internal/rosa/all.go b/internal/rosa/all.go index a46cfb8..00f01ce 100644 --- a/internal/rosa/all.go +++ b/internal/rosa/all.go @@ -24,6 +24,7 @@ const ( Git Go Gperf + Grep Gzip Hakurei HakureiDist @@ -104,6 +105,7 @@ func ResolveName(name string) (p PArtifact, ok bool) { "git": Git, "go": Go, "gperf": Gperf, + "grep": Grep, "gzip": Gzip, "hakurei": Hakurei, "hakurei-dist": HakureiDist, diff --git a/internal/rosa/gnu.go b/internal/rosa/gnu.go index ee9ef50..6d3d1e4 100644 --- a/internal/rosa/gnu.go +++ b/internal/rosa/gnu.go @@ -49,8 +49,7 @@ func (t Toolchain) newAutoconf() pkg.Artifact { checksum = "-c5blYkC-xLDer3TWEqJTyh1RLbOd1c5dnRLKsDnIrg_wWNOLBpaqMY8FvmUFJ33" ) return t.NewViaMake("autoconf", version, pkg.NewHTTPGetTar( - nil, - "https://ftpmirror.gnu.org/gnu/autoconf/autoconf-"+version+".tar.gz", + nil, "https://ftpmirror.gnu.org/gnu/autoconf/autoconf-"+version+".tar.gz", mustDecode(checksum), pkg.TarGzip, ), &MakeAttr{ @@ -250,6 +249,31 @@ func (t Toolchain) newGawk() pkg.Artifact { } func init() { artifactsF[Gawk] = Toolchain.newGawk } +func (t Toolchain) newGrep() pkg.Artifact { + const ( + version = "3.12" + checksum = "qMB4RjaPNRRYsxix6YOrjE8gyAT1zVSTy4nW4wKW9fqa0CHYAuWgPwDTirENzm_1" + ) + return t.NewViaMake("grep", version, pkg.NewHTTPGetTar( + nil, "https://ftpmirror.gnu.org/gnu/grep/grep-"+version+".tar.gz", + mustDecode(checksum), + pkg.TarGzip, + ), &MakeAttr{ + Writable: true, + ScriptEarly: ` +cd /usr/src/grep + +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 +`, + }, + t.Load(Diffutils), + ) +} +func init() { artifactsF[Grep] = Toolchain.newGrep } + func (t Toolchain) newFindutils() pkg.Artifact { const ( version = "4.10.0"