aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/fontforge.rb
diff options
context:
space:
mode:
authorKevin Ballard2013-02-17 13:26:09 -0800
committerMike McQuaid2013-02-23 08:26:25 +0000
commit67ed3bcfe7a702e2da7f7fe53db78de2384de6fd (patch)
tree23e27ac76bfab4568c599211c1f4cec0bfc17602 /Library/Formula/fontforge.rb
parent9f95fff3e43508bf7ec11ffefcf5120e5236cd27 (diff)
downloadhomebrew-67ed3bcfe7a702e2da7f7fe53db78de2384de6fd.tar.bz2
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 <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/fontforge.rb')
-rw-r--r--Library/Formula/fontforge.rb29
1 files changed, 10 insertions, 19 deletions
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"