aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/ninja.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-19 18:42:54 +0900
committerOphestra <cat@gensokyo.uk>2026-05-19 18:42:54 +0900
commit6e8bfa6c4c963ff6c7d417a1cc703e4504e1fb9d (patch)
treeab6fbdeddaff07226edf4c5e3e81b3aa0fbff41e /internal/rosa/ninja.go
parenta770d62b9be4306846b7e1d8c0c94968be175f58 (diff)
internal/rosa/package: migrate cmake
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/ninja.go')
-rw-r--r--internal/rosa/ninja.go60
1 files changed, 32 insertions, 28 deletions
diff --git a/internal/rosa/ninja.go b/internal/rosa/ninja.go
index 1040219c..e8984888 100644
--- a/internal/rosa/ninja.go
+++ b/internal/rosa/ninja.go
@@ -2,17 +2,29 @@ package rosa
import "hakurei.app/internal/pkg"
-func (t Toolchain) newNinja() (pkg.Artifact, string) {
+// Ninja is the build system used by [CMakeHelper] and [MesonHelper].
+var Ninja = H("ninja")
+
+func init() {
const (
version = "1.13.2"
checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v"
)
- _, python := t.Load(Python)
- _, bash := t.Load(Bash)
- return t.New("ninja-"+version, 0, []pkg.Artifact{
- python,
- bash,
- }, nil, nil, `
+ meta := Metadata{
+ Name: "ninja",
+ Description: "a small build system with a focus on speed",
+ Website: "https://ninja-build.org",
+ Version: version,
+
+ ID: 2089,
+ }
+ native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) {
+ _, python := t.Load(Python)
+ _, bash := t.Load(Bash)
+ return &meta, t.New(meta.Name+"-"+version, 0, []pkg.Artifact{
+ python,
+ bash,
+ }, nil, nil, `
cd "$(mktemp -d)"
python3 /usr/src/ninja/configure.py \
--verbose \
@@ -24,26 +36,18 @@ python3 /usr/src/ninja/configure.py \
mkdir -p /work/system/bin/
cp ninja /work/system/bin/
`, pkg.Path(AbsUsrSrc.Append("googletest"), false,
- newFromGitHubRelease(
- "google/googletest",
- "v1.16.0",
- "googletest-1.16.0.tar.gz",
- "NjLGvSbgPy_B-y-o1hdanlzEzaYeStFcvFGxpYV3KYlhrWWFRcugYhM3ZMzOA9B_",
- pkg.TarGzip,
- )), pkg.Path(AbsUsrSrc.Append("ninja"), true, t.NewPatchedSource(
- "ninja", version, newFromGitHub(
- "ninja-build/ninja",
- "v"+version,
- checksum,
- ), false,
- ))), version
-}
-func init() {
- native.mustRegister(Toolchain.newNinja, &Metadata{
- Name: "ninja",
- Description: "a small build system with a focus on speed",
- Website: "https://ninja-build.org/",
-
- ID: 2089,
+ newFromGitHubRelease(
+ "google/googletest",
+ "v1.16.0",
+ "googletest-1.16.0.tar.gz",
+ "NjLGvSbgPy_B-y-o1hdanlzEzaYeStFcvFGxpYV3KYlhrWWFRcugYhM3ZMzOA9B_",
+ pkg.TarGzip,
+ )), pkg.Path(AbsUsrSrc.Append("ninja"), true, t.NewPatchedSource(
+ meta.Name, version, newFromGitHub(
+ "ninja-build/ninja",
+ "v"+version,
+ checksum,
+ ), false,
+ )))
})
}