diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-24 02:43:42 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-24 04:04:09 +0900 |
| commit | 923149da444c7caa524a61880942a600c4c9e0bc (patch) | |
| tree | 261fababa3622848e2aca46f7a3ea7b1b1e5bd4b /internal | |
| parent | 8f1b287cf44f4baf2f235b2b7699e1dfb1dcaba3 (diff) | |
internal/rosa: bootstrap cmake in two steps
This enables cross-compilation via the standard CMake helper.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/rosa/cmake.go | 14 | ||||
| -rw-r--r-- | internal/rosa/llvm_test.go | 2 | ||||
| -rw-r--r-- | internal/rosa/package/cmake/package.az | 51 | ||||
| -rw-r--r-- | internal/rosa/state.go | 1 |
4 files changed, 50 insertions, 18 deletions
diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go index 8cfbf00c..2095c47a 100644 --- a/internal/rosa/cmake.go +++ b/internal/rosa/cmake.go @@ -7,6 +7,8 @@ import ( ) var ( + _cmakeEarly = H("cmake-early") + _cmake = H("cmake") _ninja = H("ninja") ) @@ -16,6 +18,9 @@ type CMakeHelper struct { // Path elements joined with source. Append []string + // Use the bootstrap minimal [MakeHelper] CMake. + Early bool + // Value of CMAKE_BUILD_TYPE. The zero value is equivalent to "Release". BuildType string // CMake CACHE entries. @@ -36,10 +41,15 @@ var _ Helper = new(CMakeHelper) // tools returns the cmake handle alongside either ninja or make. func (attr *CMakeHelper) tools(Toolchain) P { + h := _cmake + if attr != nil && attr.Early { + h = _cmakeEarly + } + if attr != nil && attr.Make { - return P{_cmake, _make} + return P{h, _make} } - return P{_cmake, _ninja} + return P{h, _ninja} } // inputs is a noop. diff --git a/internal/rosa/llvm_test.go b/internal/rosa/llvm_test.go index bc017f3e..743430a5 100644 --- a/internal/rosa/llvm_test.go +++ b/internal/rosa/llvm_test.go @@ -8,7 +8,7 @@ import ( ) func TestLLVMInputs(t *testing.T) { - const wantInputCount = 614 + const wantInputCount = 632 _, llvm := rosa.MustLoad(rosa.H("llvm")) var n int diff --git a/internal/rosa/package/cmake/package.az b/internal/rosa/package/cmake/package.az index bd67abb8..2048b9c7 100644 --- a/internal/rosa/package/cmake/package.az +++ b/internal/rosa/package/cmake/package.az @@ -1,10 +1,9 @@ -package cmake { - description = "cross-platform, open-source build system"; - website = "https://cmake.org"; - anitya = 306; +package cmake-source { + description = "CMake source tree"; + exclude = true; version# = "4.4.4"; - source = remoteGitHubRelease { + output = remoteGitHubRelease { suffix = "Kitware/CMake"; tag = "v"+version; name = "cmake-"+version+".tar.gz"; @@ -12,31 +11,53 @@ package cmake { compress = gzip; }; patches = [ "disable-broken-tests-musl.patch" ]; +} - // test suite expects writable source tree - writable = true; +package cmake-early { + description = "minimal CMake bootstrap build"; + exclude = true; + source = cmake-source; // expected to be writable in the copy made during bootstrap + writable = true; chmod = true; exec = make { defaults = false; - configureName = "/usr/src/cmake/bootstrap"; + configureName = "/usr/src/cmake-early/bootstrap"; configure = { "prefix": "/system"; "parallel": jobsE; "--"; "-DCMAKE_USE_OPENSSL": "OFF"; - "-DCMake_TEST_NO_NETWORK": "ON"; - "-DCMake_TEST_BOOTSTRAP": "OFF"; }; - check = [ - "CTEST_OUTPUT_ON_FAILURE=1", - "CTEST_PARALLEL_LEVEL=128", - "test", - ]; + // tested in full build + check = nil; + }; + + inputs = [ kernel-headers ]; +} + +package cmake { + description = "cross-platform, open-source build system"; + website = "https://cmake.org"; + anitya = 306; + source = cmake-source; + + // test suite expects writable source tree + writable = true; + chmod = true; + + exec = cmake { + early = true; + make = true; + cache = { + "CMAKE_USE_OPENSSL": "OFF"; + "CMake_TEST_NO_NETWORK": "ON"; + "CMake_TEST_BOOTSTRAP": "OFF"; + }; }; inputs = [ kernel-headers ]; diff --git a/internal/rosa/state.go b/internal/rosa/state.go index c8163ca2..d5712f5f 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -917,6 +917,7 @@ func (s *S) getFrame() azalea.Frame { var attr CMakeHelper var test azalea.AString if err = args.Apply(map[unique.Handle[azalea.Ident]]any{ + k("early"): &attr.Early, k("append"): &attr.Append, k("buildType"): &attr.BuildType, k("cache"): &attr.Cache, |
