forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmake31.rb
111 lines (89 loc) · 3.54 KB
/
cmake31.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
class NoExpatFramework < Requirement
def expat_framework
"/Library/Frameworks/expat.framework"
end
satisfy :build_env => false do
!File.exist? expat_framework
end
def message; <<-EOS.undent
Detected #{expat_framework}
This will be picked up by CMake's build system and likely cause the
build to fail, trying to link to a 32-bit version of expat.
You may need to move this file out of the way to compile CMake.
EOS
end
end
class Cmake31 < Formula
desc "Cross-platform make"
homepage "http://www.cmake.org/"
url "http://www.cmake.org/files/v3.1/cmake-3.1.3.tar.gz"
sha256 "45f4d3fa8a2f61cc092ae461aac4cac1bab4ac6706f98274ea7f314dd315c6d0"
bottle do
cellar :any
sha256 "48981ed06d94afe406570713f8463af08f86ed02d9a42914c4ca9f622ccb90e5" => :yosemite
sha256 "152cbc665728e7b5004142751dc250f7bdfbc454924f6fe73d5eff7d07860a12" => :mavericks
sha256 "957d7b2a9dfcb59693b9a54acd1ba223df8ad120eaa0a7f64cc4289d0dec3774" => :mountain_lion
end
option "without-docs", "Don't build man pages"
depends_on :python => :build if MacOS.version <= :snow_leopard && build.with?("docs")
depends_on "xz" # For LZMA
conflicts_with "cmake", :because => "both install a cmake binary"
conflicts_with "cmake28", :because => "both install a cmake binary"
conflicts_with "cmake30", :because => "both install a cmake binary"
# 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 caskroom/cask/cmake.
resource "sphinx" do
url "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.3.tar.gz"
sha256 "94933b64e2fe0807da0612c574a021c0dac28c7bd3c4a23723ae5a39ea8f3d04"
end
resource "docutils" do
url "https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz"
sha256 "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa"
end
resource "pygments" do
url "https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.2.tar.gz"
sha256 "7320919084e6dac8f4540638a46447a3bd730fca172afc17d2c03eed22cf4f51"
end
resource "jinja2" do
url "https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz"
sha256 "2e24ac5d004db5714976a04ac0e80c6df6e47e98c354cb2c0d82f8879d4f8fdb"
end
resource "markupsafe" do
url "https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.tar.gz"
sha256 "a4ec1aff59b95a14b45eb2e23761a0179e98319da5a7eb76b56ea8cdc7b871c3"
end
depends_on NoExpatFramework
def install
if build.with? "docs"
ENV.prepend_create_path "PYTHONPATH", buildpath+"sphinx/lib/python2.7/site-packages"
resources.each do |r|
r.stage do
system "python", *Language::Python.setup_install_args(buildpath/"sphinx")
end
end
# There is an existing issue around OS X & Python locale setting
# See http://bugs.python.org/issue18378#msg215215 for explanation
ENV["LC_ALL"] = "en_US.UTF-8"
end
args = %W[
--prefix=#{prefix}
--system-libs
--parallel=#{ENV.make_jobs}
--no-system-libarchive
--datadir=/share/cmake
--docdir=/share/doc/cmake
--mandir=/share/man
]
if build.with? "docs"
args << "--sphinx-man" << "--sphinx-build=#{buildpath}/sphinx/bin/sphinx-build"
end
system "./bootstrap", *args
system "make"
system "make", "install"
end
test do
(testpath/"CMakeLists.txt").write("find_package(Ruby)")
system "#{bin}/cmake", "."
end
end