aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/cmake.rb
blob: 6aff3c07b4200676ed851a9a39385f876b5a6b24 (plain)
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
require 'formula'

class Cmake < Formula
  url 'http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz'
  md5 'e1b237aeaed880f65dec9c20602452f6'
  homepage 'http://www.cmake.org/'

  # Fix issues with Xcode 4.3. Remove for 2.8.8.
  def patches
    [ 'https://github.com/Kitware/CMake/commit/5663e.patch',
      'https://github.com/Kitware/CMake/commit/4693c.patch' ]
  end

  bottle do
    sha1 '53988412bf3ebdf85dc44e8f7656f58b927b644f' => :snowleopard
    sha1 '3a57f6f44186e0dba34ef8b8fb4a9047e9e5d8a3' => :lion
  end

  def install
    # 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
        This will be picked up by CMake's build system and likey 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 for this brew to work.
      EOS
    end

    system "./bootstrap", "--prefix=#{prefix}",
                          "--system-libs",
                          "--no-system-libarchive",
                          "--datadir=/share/cmake",
                          "--docdir=/share/doc/cmake",
                          "--mandir=/share/man"
    system "make"
    system "make install"
  end
end