2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-06-04 18:21:19 +00:00
|
|
|
|
2012-04-28 18:23:45 +00:00
|
|
|
class NoExpatFramework < Requirement
|
|
|
|
def message; <<-EOS.undent
|
|
|
|
Detected /Library/Frameworks/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
|
|
|
|
def satisfied?
|
|
|
|
not File.exist? "/Library/Frameworks/expat.framework"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Cmake < Formula
|
2009-11-30 13:57:36 +00:00
|
|
|
homepage 'http://www.cmake.org/'
|
2012-07-11 06:25:57 +00:00
|
|
|
url 'http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz'
|
|
|
|
sha1 'a74dfc3e0a0d7f857ac5dda03bb99ebf07676da1'
|
2012-01-23 04:32:15 +00:00
|
|
|
|
|
|
|
bottle do
|
2012-07-12 21:16:29 +00:00
|
|
|
version 3
|
2012-07-27 12:14:43 +00:00
|
|
|
sha1 '64e1a488bc669f7676c99874b8496ac147d1bc70' => :mountainlion
|
2012-07-12 21:16:29 +00:00
|
|
|
sha1 'bdfb5fcd6743d65f6cfe00b314f9d3f1049e902b' => :lion
|
|
|
|
sha1 '3a77fc17a7b1d3cceabddcca5c126c6b911c2f90' => :snowleopard
|
2012-01-23 04:32:15 +00:00
|
|
|
end
|
2011-07-25 19:36:36 +00:00
|
|
|
|
2012-04-28 18:23:45 +00:00
|
|
|
depends_on NoExpatFramework.new
|
|
|
|
|
2012-08-13 14:35:14 +00:00
|
|
|
option 'enable-ninja', 'Enable Ninja build system support'
|
2012-07-11 06:25:57 +00:00
|
|
|
|
2012-04-28 01:36:00 +00:00
|
|
|
def patches
|
2012-05-29 22:54:29 +00:00
|
|
|
[
|
|
|
|
# Correct FindPkgConfig found variable. Remove for CMake 2.8.9.
|
|
|
|
"https://github.com/Kitware/CMake/commit/3ea850.patch",
|
2012-07-12 21:16:29 +00:00
|
|
|
# Workaround DeployQt4 issue. Remove for CMake 2.8.9.
|
|
|
|
"https://github.com/Kitware/CMake/commit/374b9b.patch",
|
2012-05-29 22:54:29 +00:00
|
|
|
# Protect the default value of CMAKE_FIND_FRAMEWORK so that it can be
|
|
|
|
# overridden from the command line. Remove for CMake 2.8.9.
|
|
|
|
"https://github.com/Kitware/CMake/commit/8b2fb3.patch"
|
|
|
|
]
|
2012-04-28 01:36:00 +00:00
|
|
|
end
|
|
|
|
|
2009-06-04 18:21:19 +00:00
|
|
|
def install
|
2012-07-11 06:25:57 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--system-libs
|
|
|
|
--no-system-libarchive
|
|
|
|
--datadir=/share/cmake
|
|
|
|
--docdir=/share/doc/cmake
|
|
|
|
--mandir=/share/man
|
|
|
|
]
|
|
|
|
|
2012-08-13 14:35:14 +00:00
|
|
|
if build.include? "enable-ninja"
|
2012-07-11 06:25:57 +00:00
|
|
|
args << "--"
|
|
|
|
args << "-DCMAKE_ENABLE_NINJA=1"
|
|
|
|
end
|
|
|
|
|
|
|
|
system "./bootstrap", *args
|
2010-07-15 04:50:29 +00:00
|
|
|
system "make"
|
2009-06-04 18:21:19 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2012-04-19 20:55:15 +00:00
|
|
|
|
|
|
|
def test
|
2012-05-15 21:36:45 +00:00
|
|
|
system "#{bin}/cmake", "-E", "echo", "testing"
|
2012-04-19 20:55:15 +00:00
|
|
|
end
|
2009-11-30 13:57:36 +00:00
|
|
|
end
|