68 lines
2.1 KiB
Ruby
68 lines
2.1 KiB
Ruby
class Cmake < Formula
|
|
desc "Cross-platform make"
|
|
homepage "https://www.cmake.org/"
|
|
url "https://cmake.org/files/v3.6/cmake-3.6.1.tar.gz"
|
|
sha256 "28ee98ec40427d41a45673847db7a905b59ce9243bb866eaf59dce0f58aaef11"
|
|
|
|
head "https://cmake.org/cmake.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "c2dd35936fd86bf1a17173e874dc8a1eb0bcc3a540b445473c7eaea0d62e7fac" => :el_capitan
|
|
sha256 "4666f51505837370e477d7762f4d6439a4f3637f945cccf6bc2542feb11ba9e8" => :yosemite
|
|
sha256 "3908d65e9ff688489bb23ce1b9d13330eda6b57a73dc34402742a637f649dd6a" => :mavericks
|
|
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 OS X & 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
|