aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-19 02:08:17 +0900
committerOphestra <cat@gensokyo.uk>2026-01-19 02:08:17 +0900
commit21858ecfe446d6bf037671687745d773f9218104 (patch)
tree163c13ed669abfdbc6783f91986d7bb425c1c35c
parent574a64aa85e8a1842f8b26d554adee8b9a6e1415 (diff)
internal/rosa: ninja artifact
Generated by cmake, recommended format for llvm toolchain. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/rosa/ninja.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/rosa/ninja.go b/internal/rosa/ninja.go
new file mode 100644
index 00000000..4cdef7a0
--- /dev/null
+++ b/internal/rosa/ninja.go
@@ -0,0 +1,35 @@
+package rosa
+
+import "hakurei.app/internal/pkg"
+
+// NewNinja returns a [pkg.Artifact] containing an installation of Ninja.
+func (t Toolchain) NewNinja() pkg.Artifact {
+ const (
+ version = "1.13.2"
+ checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v"
+ )
+ return t.New("ninja-"+version, []pkg.Artifact{
+ t.NewCMake(),
+ t.NewPython(),
+ }, nil, nil, `
+chmod -R +w /usr/src/ninja/
+mkdir -p /work/system/bin/ && cd /work/system/bin/
+python3 /usr/src/ninja/configure.py \
+ --bootstrap \
+ --gtest-source-dir=/usr/src/googletest
+./ninja all
+./ninja_test
+`, pkg.Path(AbsUsrSrc.Append("googletest"), false,
+ pkg.NewHTTPGetTar(
+ nil, "https://github.com/google/googletest/releases/download/"+
+ "v1.16.0/googletest-1.16.0.tar.gz",
+ mustDecode("NjLGvSbgPy_B-y-o1hdanlzEzaYeStFcvFGxpYV3KYlhrWWFRcugYhM3ZMzOA9B_"),
+ pkg.TarGzip,
+ )), pkg.Path(AbsUsrSrc.Append("ninja"), true,
+ pkg.NewHTTPGetTar(
+ nil, "https://github.com/ninja-build/ninja/archive/refs/tags/"+
+ "v"+version+".tar.gz",
+ mustDecode(checksum),
+ pkg.TarGzip,
+ )))
+}