homebrew-core/Formula/icu4c.rb
Jack Nagel ec11577107 Switch compilers when no build is specified
Given the current state of OS X compilers, the original fails_with
behavior is becoming less useful, mostly resulting in build failures
each time the compiler is updated. So make the following changes:

When a build is specified, we retain the old behavior: switch compilers
if the available compiler is <= the build, don't switch if it is > the
build.

When no build is specified, unconditionally switch compilers, and don't
output the advice message. This allows us to mark formulae as
perpetually failing, avoiding the need to update formulae each time a
new compiler build is made available.

As a bonus, this makes the logic much easier to reason about.

Closes Homebrew/homebrew#18175.
2013-03-12 13:55:15 -05:00

36 lines
1.1 KiB
Ruby

require 'formula'
class Icu4c < Formula
homepage 'http://site.icu-project.org/'
url 'http://download.icu-project.org/files/icu4c/50.1/icu4c-50_1-src.tgz'
version '50.1'
sha1 '9a3369c00a8be8eff935d2893849ad2eb246c0ef'
bottle do
revision 2
sha1 '34c2ab788c5ca698c1902d3d6c38db0461f8b100' => :mountain_lion
sha1 '899afa2267843f7204583884885f2c05f8189ddc' => :lion
sha1 'a54cbdd33dbdcb0fd8ed2441580e91e8ff114640' => :snow_leopard
end
keg_only "Conflicts; see: https://github.com/mxcl/homebrew/issues/issue/167"
option :universal
fails_with :clang do
cause "Icu will turn on C++11 mode when built with clang, which causes incompatibilities."
end
def install
ENV.universal_binary if build.universal?
ENV.append "LDFLAGS", "-headerpad_max_install_names"
args = ["--prefix=#{prefix}", "--disable-samples", "--disable-tests", "--enable-static"]
args << "--with-library-bits=64" if MacOS.prefer_64_bit?
cd "source" do
system "./configure", *args
system "make"
system "make install"
end
end
end