Files
hakurei/internal/rosa/gnu.go
Ophestra 8d872ff1cd
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m38s
Test / Hakurei (push) Successful in 3m53s
Test / ShareFS (push) Successful in 4m2s
Test / Hpkg (push) Successful in 4m29s
Test / Sandbox (race detector) (push) Successful in 5m1s
Test / Hakurei (race detector) (push) Successful in 5m58s
Test / Flake checks (push) Successful in 1m44s
internal/rosa: fetch from gnu mirror
GNU infrastructure is extraordinarily flaky and fetching from it killed the server too many times.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-01-31 11:26:48 +09:00

274 lines
7.2 KiB
Go

package rosa
import (
"runtime"
"strconv"
"hakurei.app/internal/pkg"
)
func (t Toolchain) newM4() pkg.Artifact {
const (
version = "1.4.20"
checksum = "RT0_L3m4Co86bVBY3lCFAEs040yI1WdeNmRylFpah8IZovTm6O4wI7qiHJN3qsW9"
)
return t.NewViaMake("m4", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/m4/m4-"+version+".tar.bz2",
mustDecode(checksum),
pkg.TarBzip2,
), &MakeAttr{
Writable: true,
ScriptEarly: `
cd /usr/src/m4
chmod +w tests/test-c32ispunct.sh && echo '#!/bin/sh' > tests/test-c32ispunct.sh
`,
},
t.Load(Diffutils),
)
}
func init() { artifactsF[M4] = Toolchain.newM4 }
func (t Toolchain) newSed() pkg.Artifact {
const (
version = "4.9"
checksum = "pe7HWH4PHNYrazOTlUoE1fXmhn2GOPFN_xE62i0llOr3kYGrH1g2_orDz0UtZ9Nt"
)
return t.NewViaMake("sed", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/sed/sed-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), nil,
t.Load(Diffutils),
)
}
func init() { artifactsF[Sed] = Toolchain.newSed }
func (t Toolchain) newAutoconf() pkg.Artifact {
const (
version = "2.72"
checksum = "-c5blYkC-xLDer3TWEqJTyh1RLbOd1c5dnRLKsDnIrg_wWNOLBpaqMY8FvmUFJ33"
)
return t.NewViaMake("autoconf", version, pkg.NewHTTPGetTar(
nil,
"https://ftpmirror.gnu.org/gnu/autoconf/autoconf-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
Env: []string{
"TESTSUITEFLAGS=" + strconv.Itoa(runtime.NumCPU()),
},
},
t.Load(M4),
t.Load(Perl),
t.Load(Bash),
t.Load(Diffutils),
)
}
func init() { artifactsF[Autoconf] = Toolchain.newAutoconf }
func (t Toolchain) newGzip() pkg.Artifact {
const (
version = "1.14"
checksum = "NWhjUavnNfTDFkZJyAUonL9aCOak8GVajWX2OMlzpFnuI0ErpBFyj88mz2xSjz0q"
)
return t.NewViaMake("gzip", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/gzip/gzip-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
// dependency loop
SkipCheck: true,
})
}
func init() { artifactsF[Gzip] = Toolchain.newGzip }
func (t Toolchain) newGettext() pkg.Artifact {
const (
version = "0.26"
checksum = "IMu7yDZX7xL5UO1ZxXc-iBMbY9LLEUlOroyuSlHMZwg9MKtxG7HIm8F2LheDua0y"
)
return t.NewViaMake("gettext", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/gettext/gettext-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
Writable: true,
ScriptEarly: `
cd /usr/src/gettext
test_disable() { chmod +w "$2" && echo "$1" > "$2"; }
test_disable '#!/bin/sh' gettext-tools/tests/msgcat-22
test_disable '#!/bin/sh' gettext-tools/tests/msgconv-2
test_disable '#!/bin/sh' gettext-tools/tests/msgconv-8
test_disable '#!/bin/sh' gettext-tools/tests/xgettext-python-3
test_disable '#!/bin/sh' gettext-tools/tests/msgmerge-compendium-6
test_disable '#!/bin/sh' gettext-tools/tests/gettextpo-1
test_disable '#!/bin/sh' gettext-tools/tests/format-c-5
test_disable '#!/bin/sh' gettext-tools/gnulib-tests/test-c32ispunct.sh
test_disable 'int main(){return 0;}' gettext-tools/gnulib-tests/test-stdcountof-h.c
touch gettext-tools/misc/archive.dir.tar
`,
},
t.Load(Diffutils),
t.Load(Gzip),
t.Load(Sed),
)
}
func init() { artifactsF[Gettext] = Toolchain.newGettext }
func (t Toolchain) newDiffutils() pkg.Artifact {
const (
version = "3.12"
checksum = "9J5VAq5oA7eqwzS1Yvw-l3G5o-TccUrNQR3PvyB_lgdryOFAfxtvQfKfhdpquE44"
)
return t.NewViaMake("diffutils", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/diffutils/diffutils-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
Writable: true,
ScriptEarly: `
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
test_disable '#!/bin/sh' tests/cmp
`,
Flag: TEarly,
})
}
func init() { artifactsF[Diffutils] = Toolchain.newDiffutils }
func (t Toolchain) newPatch() pkg.Artifact {
const (
version = "2.8"
checksum = "MA0BQc662i8QYBD-DdGgyyfTwaeALZ1K0yusV9rAmNiIsQdX-69YC4t9JEGXZkeR"
)
return t.NewViaMake("patch", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/patch/patch-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
Writable: true,
ScriptEarly: `
cd /usr/src/patch
test_disable() { chmod +w "$2" && echo "$1" > "$2"; }
test_disable '#!/bin/sh' tests/ed-style
test_disable '#!/bin/sh' tests/need-filename
`,
Flag: TEarly,
})
}
func init() { artifactsF[Patch] = Toolchain.newPatch }
func (t Toolchain) newBash() pkg.Artifact {
const (
version = "5.3"
checksum = "4LQ_GRoB_ko-Ih8QPf_xRKA02xAm_TOxQgcJLmFDT6udUPxTAWrsj-ZNeuTusyDq"
)
return t.NewViaMake("bash", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/bash/bash-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
Script: "ln -s bash /work/system/bin/sh\n",
Configure: [][2]string{
{"without-bash-malloc"},
},
Flag: TEarly,
})
}
func init() { artifactsF[Bash] = Toolchain.newBash }
func (t Toolchain) newCoreutils() pkg.Artifact {
const (
version = "9.9"
checksum = "B1_TaXj1j5aiVIcazLWu8Ix03wDV54uo2_iBry4qHG6Y-9bjDpUPlkNLmU_3Nvw6"
)
return t.NewViaMake("coreutils", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/coreutils/coreutils-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
Writable: true,
ScriptEarly: `
cd /usr/src/coreutils
test_disable() { chmod +w "$2" && echo "$1" > "$2"; }
test_disable '#!/bin/sh' gnulib-tests/test-c32ispunct.sh
test_disable '#!/bin/sh' tests/split/line-bytes.sh
test_disable '#!/bin/sh' tests/dd/no-allocate.sh
`,
Flag: TEarly,
},
t.Load(Perl),
t.Load(Bash),
t.Load(KernelHeaders),
)
}
func init() { artifactsF[Coreutils] = Toolchain.newCoreutils }
func (t Toolchain) newGperf() pkg.Artifact {
const (
version = "3.3"
checksum = "RtIy9pPb_Bb8-31J2Nw-rRGso2JlS-lDlVhuNYhqR7Nt4xM_nObznxAlBMnarJv7"
)
return t.NewViaMake("gperf", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gperf/gperf-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), nil,
t.Load(Diffutils),
)
}
func init() { artifactsF[Gperf] = Toolchain.newGperf }
func (t Toolchain) newGawk() pkg.Artifact {
const (
version = "5.3.2"
checksum = "uIs0d14h_d2DgMGYwrPtegGNyt_bxzG3D6Fe-MmExx_pVoVkQaHzrtmiXVr6NHKk"
)
return t.NewViaMake("gawk", version, pkg.NewHTTPGetTar(
nil, "https://ftpmirror.gnu.org/gnu/gawk/gawk-"+version+".tar.gz",
mustDecode(checksum),
pkg.TarGzip,
), &MakeAttr{
Flag: TEarly,
// dependency loop
SkipCheck: true,
})
}
func init() { artifactsF[Gawk] = Toolchain.newGawk }
func (t Toolchain) newFindutils() pkg.Artifact {
const (
version = "4.10.0"
checksum = "ZXABdNBQXL7QjTygynRRTdXYWxQKZ0Wn5eMd3NUnxR0xaS0u0VfcKoTlbo50zxv6"
)
return t.NewViaMake("findutils", version, pkg.NewHTTPGet(
nil, "https://ftpmirror.gnu.org/gnu/findutils/findutils-"+version+".tar.xz",
mustDecode(checksum),
), &MakeAttr{
SourceSuffix: ".tar.xz",
ScriptEarly: `
cd /usr/src/
tar xf findutils.tar.xz
mv findutils-` + version + ` findutils
cd findutils
echo '#!/bin/sh' > gnulib-tests/test-c32ispunct.sh
echo 'int main(){return 0;}' > tests/xargs/test-sigusr.c
`,
},
t.Load(Diffutils),
t.Load(XZ),
t.Load(Sed),
)
}
func init() { artifactsF[Findutils] = Toolchain.newFindutils }