From dc963021114a4e2ffa874d4838382a1ad67a4f53 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 19 Jan 2026 00:35:17 +0900 Subject: [PATCH] internal/rosa: GNU make artifact This compiles GNU make from source. This is unfortunately required by many programs, but is a cure dependency only. Signed-off-by: Ophestra --- container/fhs/abs.go | 2 ++ internal/rosa/gnu.go | 25 +++++++++++++++++++++++++ internal/rosa/rosa.go | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 internal/rosa/gnu.go diff --git a/container/fhs/abs.go b/container/fhs/abs.go index dfd3c04..fda6971 100644 --- a/container/fhs/abs.go +++ b/container/fhs/abs.go @@ -26,6 +26,8 @@ var ( // AbsRunUser is [RunUser] as [check.Absolute]. AbsRunUser = unsafeAbs(RunUser) + // AbsUsr is [Usr] as [check.Absolute]. + AbsUsr = unsafeAbs(Usr) // AbsUsrBin is [UsrBin] as [check.Absolute]. AbsUsrBin = unsafeAbs(UsrBin) diff --git a/internal/rosa/gnu.go b/internal/rosa/gnu.go new file mode 100644 index 0000000..8fe5b8a --- /dev/null +++ b/internal/rosa/gnu.go @@ -0,0 +1,25 @@ +package rosa + +import "hakurei.app/internal/pkg" + +// NewMake returns a [pkg.Artifact] containing an installation of GNU Make. +func (t Toolchain) NewMake() pkg.Artifact { + const ( + version = "4.4.1" + checksum = "YS_B07ZcAy9PbaK5_vKGj64SrxO2VMpnMKfc9I0Q9IC1rn0RwOH7802pJoj2Mq4a" + ) + return t.New("make-"+version, nil, nil, nil, ` +cd "$(mktemp -d)" +/usr/src/make/configure --prefix=/system \ + --build="${ROSA_TRIPLE}" \ + --disable-dependency-tracking +./build.sh +./make DESTDIR=/work install +`, pkg.Path(AbsUsrSrc.Append("make"), false, pkg.NewHTTPGetTar( + nil, + "https://ftp.gnu.org/gnu/make/make-"+version+".tar.gz", + mustDecode(checksum), + pkg.TarGzip, + ))) + +} diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index 1aff698..d7a6105 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -36,6 +36,9 @@ func mustDecode(s string) pkg.Checksum { } var ( + // AbsUsrSrc is the conventional directory to place source code under. + AbsUsrSrc = fhs.AbsUsr.Append("src") + // AbsSystem is the Rosa OS installation prefix. AbsSystem = fhs.AbsRoot.Append("system") )