From e11a18b90f16b78ca73bfc3859ba3163766f5524 Mon Sep 17 00:00:00 2001 From: Adrian Ho Date: Wed, 4 Sep 2024 23:41:09 +0800 Subject: [PATCH] cmake: update 3.30.3 bottle. --- Formula/c/cmake.rb | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Formula/c/cmake.rb diff --git a/Formula/c/cmake.rb b/Formula/c/cmake.rb new file mode 100644 index 00000000000..26f60973715 --- /dev/null +++ b/Formula/c/cmake.rb @@ -0,0 +1,76 @@ +class Cmake < Formula + desc "Cross-platform make" + homepage "https://www.cmake.org/" + url "https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3.tar.gz" + mirror "http://fresh-center.net/linux/misc/cmake-3.30.3.tar.gz" + mirror "http://fresh-center.net/linux/misc/legacy/cmake-3.30.3.tar.gz" + sha256 "6d5de15b6715091df7f5441007425264bdd477809f80333fdf95f846aaff88e4" + license "BSD-3-Clause" + head "https://gitlab.kitware.com/cmake/cmake.git", branch: "master" + + # The "latest" release on GitHub has been an unstable version before, and + # there have been delays between the creation of a tag and the corresponding + # release, so we check the website's downloads page instead. + livecheck do + url "https://cmake.org/download/" + regex(/href=.*?cmake[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + bottle do + root_url "https://github.com/gromgit/homebrew-core-aarch64_linux/releases/download/cmake-3.30.3" + sha256 cellar: :any_skip_relocation, aarch64_linux: "743e0b2f47179b3ca76bc288215a93262f15b804fbb0590532040ce2098506e1" + end + + uses_from_macos "ncurses" + + on_linux do + depends_on "openssl@3" + end + + # The completions were removed because of problems with system bash + + # The `with-qt` GUI option was removed due to circular dependencies if + # CMake is built with Qt support and Qt is built with MySQL support as MySQL uses CMake. + # For the GUI application please instead use `brew install --cask cmake`. + + def install + args = %W[ + --prefix=#{prefix} + --no-system-libs + --parallel=#{ENV.make_jobs} + --datadir=/share/cmake + --docdir=/share/doc/cmake + --mandir=/share/man + ] + if OS.mac? + args += %w[ + --system-zlib + --system-bzip2 + --system-curl + ] + end + + system "./bootstrap", *args, "--", *std_cmake_args, + "-DCMake_INSTALL_BASH_COMP_DIR=#{bash_completion}", + "-DCMake_INSTALL_EMACS_DIR=#{elisp}", + "-DCMake_BUILD_LTO=ON" + system "make" + system "make", "install" + end + + def caveats + <<~EOS + To install the CMake documentation, run: + brew install cmake-docs + EOS + end + + test do + (testpath/"CMakeLists.txt").write("find_package(Ruby)") + system bin/"cmake", "." + + # These should be supplied in a separate cmake-docs formula. + refute_path_exists doc/"html" + refute_path_exists man + end +end