build.lua 1222 bytes · raw
-- The release binaries of the build machine, copied whole into the prefix: cmake finds its modules (share/cmake-4.4)
-- beside its bin/. Kitware's are for glibc: on a machine of musl (no resource active) CMake is built from source, by
-- its bootstrap with the Ninja of the toolchain (MAKE), without OpenSSL (a build tool here: the builds run offline).
function build(slice, options, deps)
local r = slice.resources
local release = r.linux_x86_64 or r.linux_arm64
local p = slice.prefix
if release then
for _, dir in ipairs{ "bin", "share" } do
otok.copy(release .. "/" .. dir, p .. "/" .. dir)
end
else
local ninja = slice.toolchains.ninja
otok.run({ slice.source .. "/bootstrap", "--prefix=" .. p, "--generator=Ninja", "--parallel=" .. slice.jobs, "--",
"-DCMAKE_USE_OPENSSL=OFF", "-DBUILD_TESTING=OFF", "-DCMAKE_BUILD_TYPE=Release" },
{ cwd = slice.build, env = { MAKE = ninja, CC = slice.toolchain.cc, CXX = slice.toolchain.cxx } })
otok.run({ ninja, "install" }, { cwd = slice.build })
end
return { programs = { cmake = p .. "/bin/cmake", ctest = p .. "/bin/ctest", cpack = p .. "/bin/cpack" } }
end
recipe.toml 1761 bytes · raw
# The otok recipe of CMake (https://github.com/apotocki/otok): the cmake program for the builds of other recipes, which
# name it as their toolchain (`cmake = { default-recipe = "apotocki/cmake" }`), on Linux: Kitware's release binaries of
# the build machine (a resource per architecture, fetched on that machine only), which are for glibc; on a machine of
# musl (Alpine, `linux-<arch>-musl`) CMake built from the source archive by its bootstrap, with Ninja. The source
# archive carries the license.
[recipe]
api = 1
library = "cmake"
name = "cmake"
version = "4.4.5"
revision = 2
license = "BSD-3-Clause"
license-files = ["LICENSE.rst"]
homepage = "https://cmake.org"
description = "CMake, the cross-platform build system generator, as Kitware releases it."
keywords = ["build", "tool"]
[tool]
programs = ["cmake", "ctest", "cpack"]
[source]
url = "https://github.com/Kitware/CMake/releases/download/v4.4.5/cmake-4.4.5.tar.gz"
sha256 = "a0c54c88abb8078dd8eccadb717fc6bb194bf18e7d44c86309910288886e04e2"
[[resource]]
name = "linux_x86_64"
url = "https://github.com/Kitware/CMake/releases/download/v4.4.5/cmake-4.4.5-linux-x86_64.tar.gz"
sha256 = "ed85135c5a5135b45e50423cb406dea04ca3338da0b8ef3c9ede963559680be0"
when = { host = ["linux-x86_64"] }
[[resource]]
name = "linux_arm64"
url = "https://github.com/Kitware/CMake/releases/download/v4.4.5/cmake-4.4.5-linux-aarch64.tar.gz"
sha256 = "301d5063ab259577c1b57ce5490b1aab9ea5c56dc4c822f73499553dab94925f"
when = { host = ["linux-arm64"] }
[toolchains]
# the bootstrap's generator where no release binary runs; the recipes that build with cmake name ninja too
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }
[platforms]
supported = ["linux"]
build-on = ["linux/gcc", "linux/clang"]