diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go index 10b2afc0..127423d1 100644 --- a/internal/rosa/cmake.go +++ b/internal/rosa/cmake.go @@ -6,7 +6,10 @@ import ( "strings" ) -var _cmake = H("cmake") +var ( + _cmake = H("cmake") + _ninja = H("ninja") +) // CMakeHelper is the [CMake] build system helper. type CMakeHelper struct { diff --git a/internal/rosa/ninja.go b/internal/rosa/ninja.go deleted file mode 100644 index 74f82998..00000000 --- a/internal/rosa/ninja.go +++ /dev/null @@ -1,52 +0,0 @@ -package rosa - -import "hakurei.app/internal/pkg" - -var _ninja = H("ninja") - -func init() { - const ( - version = "1.13.2" - checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v" - ) - 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 \ - --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, t.NewPatchedSource( - meta.Name+"-"+version, newFromGitHub( - "ninja-build/ninja", - "v"+version, - checksum, - ), false, - ))) - }) -} diff --git a/internal/rosa/package/googletest.az b/internal/rosa/package/googletest.az new file mode 100644 index 00000000..e7cee75f --- /dev/null +++ b/internal/rosa/package/googletest.az @@ -0,0 +1,14 @@ +package googletest { + description = "Google Testing and Mocking Framework"; + exclude = true; + anitya = 18290; + + version* = "1.16.0"; + output = remoteGitHubRelease { + suffix = "google/googletest"; + tag = "v"+version; + name = "googletest-"+version+".tar.gz"; + checksum = "NjLGvSbgPy_B-y-o1hdanlzEzaYeStFcvFGxpYV3KYlhrWWFRcugYhM3ZMzOA9B_"; + compress = gzip; + }; +} diff --git a/internal/rosa/package/ninja.az b/internal/rosa/package/ninja.az new file mode 100644 index 00000000..32cf8375 --- /dev/null +++ b/internal/rosa/package/ninja.az @@ -0,0 +1,34 @@ +package ninja { + description = "a small build system with a focus on speed"; + website = "https://ninja-build.org"; + anitya = 2089; + + version* = "1.13.2"; + source = remoteGitHub { + suffix = "ninja-build/ninja"; + tag = "v"+version; + checksum = "ygKWMa0YV2lWKiFro5hnL-vcKbc_-RACZuPu0Io8qDvgQlZ0dxv7hPNSFkt4214v"; + }; + extra = [ googletest ]; + + exec = generic { + build = ` +python3 /usr/src/ninja/configure.py \ + --verbose \ + --bootstrap +python3 /usr/src/ninja/configure.py \ + --gtest-source-dir=/usr/src/extra/googletest +./ninja ` + jobsFlagE + ` all`; + + check = "\n./ninja_test"; + + install = ` +mkdir -p /work/system/bin/ +cp ninja /work/system/bin/`; + }; + + inputs = [ + python, + bash, + ]; +}