From 82736836c92f4c0aa3a0e6a2be294bfe047da0c8 Mon Sep 17 00:00:00 2001 From: nibbles 2bits Date: Tue, 19 Jun 2012 23:09:40 -0700 Subject: cairo: fix llvm compile error, add --universal Cairo-1.10.2 doesn't build well with link time optimization. Patch `configure` to remove `-flto`. This fixes the build error with llvm. This also fixes a build error when brewing cairo as a universal library. Add `--universal` option. Works if gettext & glib are universal. Patch `configure` to change `-Werror-implicit-function-declaration` to a warning with `-Wimplicit-function-declaration`. Fixes a build error when universal & clang. Tested on Lion with clang and llvm from XCode-4.3.3. Tested by building py2cairo and `import cairo`. Fixes #12923 and #10400 Signed-off-by: Adam Vandenberg --- Library/Formula/cairo.rb | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/cairo.rb b/Library/Formula/cairo.rb index ce3a38970..c682adbe9 100644 --- a/Library/Formula/cairo.rb +++ b/Library/Formula/cairo.rb @@ -11,12 +11,19 @@ class Cairo < Formula keg_only :provided_by_osx, "The Cairo provided by Leopard is too old for newer software to link against." - fails_with :llvm do - build 2336 - cause "Throws an 'lto could not merge' error during build." + def options + [['--universal', 'Build a universal library']] end + # Fixes a build error with llvm, 'lto could not merge'. Fixes a build error + # when brewing universal, cannot use 'lto-bc' with multiple -arch options. + # Fixes a build error with clang & universal, where a function was implicit. + # Not reported upstream because we are using an old version, Cairo-1.10.2. + # cf. issues #12923 and #10400 + def patches; DATA; end + def install + ENV.universal_binary if ARGV.include? '--universal' args = %W[ --disable-dependency-tracking --prefix=#{prefix} @@ -28,3 +35,25 @@ class Cairo < Formula system "make install" end end + +__END__ +--- a/configure 2010-12-25 06:22:57.000000000 -0800 ++++ b/configure 2012-06-19 22:39:49.000000000 -0700 +@@ -17224,7 +17224,7 @@ + + MAYBE_WARN="-Wall -Wextra \ + -Wold-style-definition -Wdeclaration-after-statement \ +--Wmissing-declarations -Werror-implicit-function-declaration \ ++-Wmissing-declarations -Wimplicit-function-declaration \ + -Wnested-externs -Wpointer-arith -Wwrite-strings \ + -Wsign-compare -Wstrict-prototypes -Wmissing-prototypes \ + -Wpacked -Wswitch-enum -Wmissing-format-attribute \ +@@ -17236,7 +17236,7 @@ + MAYBE_WARN="$MAYBE_WARN -erroff=E_ENUM_TYPE_MISMATCH_ARG \ + -erroff=E_ENUM_TYPE_MISMATCH_OP" + +-MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common -flto" ++MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common" + + MAYBE_WARN="$MAYBE_WARN -Wp,-D_FORTIFY_SOURCE=2" + -- cgit v1.2.3