From 67ed3bcfe7a702e2da7f7fe53db78de2384de6fd Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sun, 17 Feb 2013 13:26:09 -0800 Subject: fontforge: fix compilation without 10.7 SDK FontForge uses the FlatCarbon headers, which are gone in Mountain Lion. To fix this, the formula was adjusted to use the 10.7 SDK. However, this prevents compiling FontForge on a system without the 10.7 SDK. Fix this by replacing the FlatCarbon imports with the correct imports to the non-flat headers. Closes #17909. Signed-off-by: Mike McQuaid --- Library/Formula/fontforge.rb | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/fontforge.rb b/Library/Formula/fontforge.rb index 7abb304d8..3623629c1 100644 --- a/Library/Formula/fontforge.rb +++ b/Library/Formula/fontforge.rb @@ -31,16 +31,6 @@ class Fontforge < Formula end def install - # Reason: Designed for the 10.7 SDK because it uses FlatCarbon. - # MACOSX_DEPLOYMENT_TARGET fixes ensuing Python 10.7 vs 10.8 clash. - # Discussed: https://github.com/mxcl/homebrew/pull/14097 - # Reported: Not yet. - if MacOS.version >= :mountain_lion - ENV.macosxsdk("10.7") - ENV.append "CFLAGS", "-isysroot #{MacOS.sdk_path(10.7)}" - ENV["MACOSX_DEPLOYMENT_TARGET"] = "10.8" - end - args = ["--prefix=#{prefix}", "--enable-double", "--without-freetype-bytecode"] @@ -62,6 +52,10 @@ class Fontforge < Formula # Reset ARCHFLAGS to match how we build ENV["ARCHFLAGS"] = MacOS.prefer_64_bit? ? "-arch x86_64" : "-arch i386" + # Set up framework paths so FlatCarbon replacement paths work (see below) + ENV.append "CFLAGS", "-F/System/Library/Frameworks/CoreServices.framework/Frameworks" + ENV.append "CFLAGS", "-F/System/Library/Frameworks/Carbon.framework/Frameworks" + args << "--without-cairo" unless build.with? "cairo" args << "--without-pango" unless build.with? "pango" @@ -79,16 +73,13 @@ class Fontforge < Formula s.gsub! "python setup.py install --prefix=$(prefix) --root=$(DESTDIR)", "python setup.py install --prefix=$(prefix)" end - # Fix hard-coded include file paths. Reported usptream: - # http://sourceforge.net/mailarchive/forum.php?thread_name=C1A32103-A62D-468B-AD8A-A8E0E7126AA5%40smparkes.net&forum_name=fontforge-devel - # https://trac.macports.org/ticket/33284 - if MacOS::Xcode.version >= '4.4' - header_prefix = "#{MacOS.sdk_path(10.7)}/Developer" - else - header_prefix = MacOS::Xcode.prefix - end + # Replace FlatCarbon headers with the real paths + # Fixes building on 10.8 inreplace %w(fontforge/macbinary.c fontforge/startui.c gutils/giomime.c) do |s| - s.gsub! "/Developer", header_prefix + s.gsub! "/Developer/Headers/FlatCarbon/Files.h", "CarbonCore/Files.h" + end + inreplace %w(fontforge/startui.c) do |s| + s.gsub! "/Developer/Headers/FlatCarbon/CarbonEvents.h", "HIToolbox/CarbonEvents.h" end system "make" -- cgit v1.2.3