67 lines
2.1 KiB
Ruby
67 lines
2.1 KiB
Ruby
class Cmake < Formula
|
|
desc "Cross-platform make"
|
|
homepage "https://www.cmake.org/"
|
|
url "https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz"
|
|
sha256 "acbf13af31a741794106b76e5d22448b004a66485fc99f6d7df4d22e99da164a"
|
|
head "https://cmake.org/cmake.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "7621c1684f0501f93c3bdf0b93dbae8881cd45edc42c8ad6952c42824a6247fb" => :mojave
|
|
sha256 "11d1f19c0a4425665573c46032d5cd73297181eba8f329b7a0deb12c2eb1fb66" => :high_sierra
|
|
sha256 "a940f8d8e9818512c466ffd205612cb1b477d936e87ab3d6c7dac888f6d03b92" => :sierra
|
|
end
|
|
|
|
option "with-completion", "Install Bash completion (Has potential problems with system bash)"
|
|
|
|
depends_on "sphinx-doc" => :build
|
|
|
|
# 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`.
|
|
|
|
needs :cxx11
|
|
|
|
def install
|
|
ENV.cxx11 if MacOS.version < :mavericks
|
|
|
|
# Avoid the following compiler error:
|
|
# SecKeychain.h:102:46: error: shift expression '(1853123693 << 8)' overflows
|
|
ENV.append_to_cflags "-fpermissive" if MacOS.version <= :lion
|
|
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--no-system-libs
|
|
--parallel=#{ENV.make_jobs}
|
|
--datadir=/share/cmake
|
|
--docdir=/share/doc/cmake
|
|
--mandir=/share/man
|
|
--sphinx-build=#{Formula["sphinx-doc"].opt_bin}/sphinx-build
|
|
--sphinx-man
|
|
--system-zlib
|
|
--system-bzip2
|
|
--system-curl
|
|
]
|
|
|
|
# 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"
|
|
|
|
system "./bootstrap", *args, "--", "-DCMAKE_BUILD_TYPE=Release"
|
|
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
|