2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-06-04 18:21:19 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Cmake < Formula
|
2011-07-16 10:37:29 +00:00
|
|
|
url 'http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz'
|
|
|
|
md5 '3c5d32cec0f4c2dc45f4c2e84f4a20c5'
|
2009-11-30 13:57:36 +00:00
|
|
|
homepage 'http://www.cmake.org/'
|
2011-08-25 01:35:51 +00:00
|
|
|
bottle 'https://downloads.sf.net/project/machomebrew/Bottles/cmake-2.8.5-bottle.tar.gz'
|
|
|
|
bottle_sha1 'f7a4c459625eb9282fef9789cab2a702a2dff06a'
|
2009-06-04 18:21:19 +00:00
|
|
|
|
2011-07-25 19:36:36 +00:00
|
|
|
def patches
|
|
|
|
# CMake 2.8.5 fails to find some Qt libraries that CMake 2.8.4 could find.
|
|
|
|
# The following patch corrects this behavior. See discussion on the CMake
|
|
|
|
# mailing list:
|
|
|
|
#
|
|
|
|
# http://cmake.3232098.n2.nabble.com/FindQt4-errors-out-when-locating-QtUITools-under-CMake-2-8-5-td6619091.html
|
|
|
|
#
|
|
|
|
# Patch can be removed after next CMake release.
|
|
|
|
{:p1 => "http://cmake.org/gitweb?p=cmake.git;a=patch;h=702538eaa3315f3fcad9f1daea01e6a83928967b"}
|
|
|
|
end
|
|
|
|
|
2009-06-04 18:21:19 +00:00
|
|
|
def install
|
2010-12-26 21:29:01 +00:00
|
|
|
# A framework-installed expat will be detected and mess things up.
|
|
|
|
if File.exist? "/Library/Frameworks/expat.framework"
|
|
|
|
opoo "/Library/Frameworks/expat.framework detected"
|
|
|
|
puts <<-EOS.undent
|
2011-08-25 01:35:51 +00:00
|
|
|
This will be picked up by CMake's build system and likey cause the
|
2010-12-26 21:29:01 +00:00
|
|
|
build to fail, trying to link to a 32-bit version of expat.
|
|
|
|
You may need to move this file out of the way for this brew to work.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2011-04-08 05:01:16 +00:00
|
|
|
if ENV['GREP_OPTIONS'] == "--color=always"
|
|
|
|
opoo "GREP_OPTIONS is set to '--color=always'"
|
|
|
|
puts <<-EOS.undent
|
2011-08-25 01:35:51 +00:00
|
|
|
Having `GREP_OPTIONS` set this way causes CMake builds to fail.
|
2011-04-08 05:01:16 +00:00
|
|
|
You will need to `unset GREP_OPTIONS` before brewing.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2009-08-07 14:41:43 +00:00
|
|
|
system "./bootstrap", "--prefix=#{prefix}",
|
|
|
|
"--system-libs",
|
2011-01-13 18:15:10 +00:00
|
|
|
"--no-system-libarchive",
|
2009-08-07 14:41:43 +00:00
|
|
|
"--datadir=/share/cmake",
|
|
|
|
"--docdir=/share/doc/cmake",
|
|
|
|
"--mandir=/share/man"
|
2010-07-15 04:50:29 +00:00
|
|
|
system "make"
|
2009-06-04 18:21:19 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2009-11-30 13:57:36 +00:00
|
|
|
end
|