homebrew-core/Formula/libagg.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

44 lines
1.3 KiB
Ruby

require 'formula'
class Libagg < Formula
homepage 'http://www.antigrain.com'
url 'http://www.antigrain.com/agg-2.5.tar.gz'
sha1 '08f23da64da40b90184a0414369f450115cdb328'
depends_on :automake
depends_on :libtool
depends_on 'pkg-config' => :build
depends_on 'sdl'
depends_on :freetype => :optional
fails_with :clang do
cause <<-EOS.undent
AGG tries to return a const reference as a non-const reference, which is
rejected by clang 3.1 but accepted by gcc
EOS
end
def install
# AM_C_PROTOTYPES was removed in automake 1.12, as it's only needed for
# pre-ANSI compilers
inreplace 'configure.in', 'AM_C_PROTOTYPES', ''
# No configure script. We need to run autoreconf, and aclocal and automake
# need some direction.
ENV['ACLOCAL'] = "aclocal -I#{HOMEBREW_PREFIX}/share/aclocal" # To find SDL m4 files
# This part snatched from MacPorts
ENV['AUTOMAKE'] = "automake --foreign --add-missing --ignore-deps"
system "autoreconf -fi"
system "./configure",
"--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--disable-platform", # Causes undefined symbols
"--disable-ctrl", # No need to run these during configuration
"--disable-examples",
"--disable-sdltest"
system "make install"
end
end