homebrew-core/Formula/cmake.rb
2016-11-12 08:10:11 -08:00

67 lines
2.1 KiB
Ruby

class Cmake < Formula
desc "Cross-platform make"
homepage "https://www.cmake.org/"
url "https://cmake.org/files/v3.7/cmake-3.7.0.tar.gz"
sha256 "ed63e05c41aeb6c036e503114ab15847f29c312f9f21f5f1a7060a4b4ec2fb31"
head "https://cmake.org/cmake.git"
bottle do
cellar :any_skip_relocation
sha256 "00ad8d08a44f8a1784290bc4cfb60181ede4ef3ee7e148161fd097d1ffb4807d" => :sierra
sha256 "741f4c7869781dbdb87709a83c1476a7bb74962106f2894c21d809f48c72310b" => :el_capitan
sha256 "3c44c20cb51f6151d5ad0eeb7ab026d2b2cc5a70cfdc9acd5e339a56cc54aa79" => :yosemite
end
option "without-docs", "Don't build man pages"
option "with-completion", "Install Bash completion (Has potential problems with system bash)"
depends_on "sphinx-doc" => :build if build.with? "docs"
# 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 cask install cmake`.
def install
args = %W[
--prefix=#{prefix}
--no-system-libs
--parallel=#{ENV.make_jobs}
--datadir=/share/cmake
--docdir=/share/doc/cmake
--mandir=/share/man
--system-zlib
--system-bzip2
]
# https://github.com/Homebrew/legacy-homebrew/issues/45989
if MacOS.version <= :lion
args << "--no-system-curl"
else
args << "--system-curl"
end
if build.with? "docs"
# There is an existing issue around macOS & Python locale setting
# See https://bugs.python.org/issue18378#msg215215 for explanation
ENV["LC_ALL"] = "en_US.UTF-8"
args << "--sphinx-man" << "--sphinx-build=#{Formula["sphinx-doc"].opt_bin}/sphinx-build"
end
system "./bootstrap", *args
system "make"
system "make", "install"
if build.with? "completion"
cd "Auxiliary/bash-completion/" do
bash_completion.install "ctest", "cmake", "cpack"
end
end
elisp.install "Auxiliary/cmake-mode.el"
end
test do
(testpath/"CMakeLists.txt").write("find_package(Ruby)")
system bin/"cmake", "."
end
end