-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |