Files
hakurei/internal/rosa/ninja.go
Ophestra 916093770a
Some checks failed
Test / Create distribution (push) Failing after 50s
Test / ShareFS (push) Failing after 55s
Test / Hakurei (push) Failing after 1m11s
Test / Sandbox (race detector) (push) Failing after 1m11s
Test / Sandbox (push) Failing after 1m21s
Test / Hakurei (race detector) (push) Failing after 1m34s
Test / Flake checks (push) Has been skipped
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-05-17 15:05:52 +09:00

52 lines
1.2 KiB
Go

package rosa
import "hakurei.app/internal/pkg"
func (t Toolchain) newNinja(s *S) (pkg.Artifact, string) {
const (
version = "1.13.2"
checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v"
)
python, _ := s.Load(t, Python)
bash, _ := s.Load(t, Bash)
return s.New(t, "ninja-"+version, 0, []pkg.Artifact{
python,
bash,
}, nil, nil, `
cd "$(mktemp -d)"
python3 /usr/src/ninja/configure.py \
--verbose \
--bootstrap \
--gtest-source-dir=/usr/src/googletest
./ninja `+jobsFlagE+` all
./ninja_test
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, s.NewPatchedSource(t,
"ninja", version, newFromGitHub(
"ninja-build/ninja",
"v"+version,
checksum,
), false,
))), version
}
func init() {
native.MustRegister(&Artifact{
f: Toolchain.newNinja,
Name: "ninja",
Description: "a small build system with a focus on speed",
Website: "https://ninja-build.org/",
ID: 2089,
})
}