From 4ef247c6b69d028c40a792ca4289f93958fc2a48 Mon Sep 17 00:00:00 2001 From: nibbles 2bits Date: Sat, 20 Oct 2012 10:43:28 -0700 Subject: [PATCH] fontconfig: add patch for universal builds fontconfig fails to build universally due to SIZEOF_VOID issues that are solved by adapting the Macports patch for that to our newer version of fontconfig. Closes Homebrew/homebrew#15567. Signed-off-by: Adam Vandenberg --- Formula/fontconfig.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Formula/fontconfig.rb b/Formula/fontconfig.rb index 9b72e037d1c..73ef5a3c398 100644 --- a/Formula/fontconfig.rb +++ b/Formula/fontconfig.rb @@ -12,9 +12,38 @@ class Fontconfig < Formula depends_on :freetype depends_on 'pkg-config' => :build + # Patch adapted from Macports patch for 2.9.0 defines sizeof based on __LP64__ + # Fixes universal builds but seems groovy enough to apply in all cases. + # https://trac.macports.org/browser/trunk/dports/graphics/fontconfig/files/patch-check-arch-at-runtime.diff + def patches; DATA; end + def install ENV.universal_binary if build.universal? system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make install" end end + +__END__ +--- a/src/fcarch.h 2012-07-23 19:01:32.000000000 -0700 ++++ b/src/fcarch.h 2012-10-20 10:29:15.000000000 -0700 +@@ -46,6 +46,19 @@ + * be64 1234 8 8 + */ + ++#ifdef __APPLE__ ++# include ++# undef SIZEOF_VOID_P ++# undef ALIGNOF_DOUBLE ++# ifdef __LP64__ ++# define SIZEOF_VOID_P 8 ++# define ALIGNOF_DOUBLE 8 ++# else ++# define SIZEOF_VOID_P 4 ++# define ALIGNOF_DOUBLE 4 ++# endif ++#endif ++ + #if defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN + # define FC_ARCH_ENDIAN "le" + #elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN