diff options
| author | nibbles 2bits | 2012-08-27 10:10:09 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2012-08-28 11:21:58 -0700 |
| commit | 93c1525c1f89156c998311f9db46ef97174293eb (patch) | |
| tree | cf156b246d8f840cc978c46c2d1205b353b90878 /Library | |
| parent | b4069513947dfd571ee5c0f31c5ee7797c9730d8 (diff) | |
| download | homebrew-93c1525c1f89156c998311f9db46ef97174293eb.tar.bz2 | |
fontforge: force 10.7 SDK, fix hard-coded includes
fontforge fails to build on 10.8 due to being designed for 10.7
through the use of `<FlatCarbon/Files.h>`. Force the formula
to use 10.7 SDK. Patch the hard-coded paths with the HB variable
`MacOS.sdk_path(10.7)}` as needed. Tested on 10.8 using clang
and from XCode-4.4.1.
Fixes #14421
Closes #14482.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/fontforge.rb | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/Library/Formula/fontforge.rb b/Library/Formula/fontforge.rb index f1b0936ef..d523f3b43 100644 --- a/Library/Formula/fontforge.rb +++ b/Library/Formula/fontforge.rb @@ -4,7 +4,6 @@ class Fontforge < Formula homepage 'http://fontforge.sourceforge.net' url 'http://downloads.sourceforge.net/project/fontforge/fontforge-source/fontforge_full-20120731-b.tar.bz2' sha1 'b520f532b48e557c177dffa29120225066cc4e84' - version '20120731' head 'https://github.com/fontforge/fontforge.git' @@ -16,9 +15,7 @@ class Fontforge < Formula depends_on :x11 depends_on :xcode # Because: #include </Developer/Headers/FlatCarbon/Files.h> - def options - [['--without-python', 'Build without Python.']] - end + option 'without-python', 'Build without Python' fails_with :llvm do build 2336 @@ -26,11 +23,21 @@ 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.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"] - if ARGV.include? "--without-python" + if build.include? "without-python" args << "--without-python" else python_prefix = `python-config --prefix`.strip @@ -40,10 +47,8 @@ class Fontforge < Formula args << "--enable-pyextension" end - ENV.macosxsdk("10.7") if MacOS.mountain_lion? - # Fix linking to correct Python library - ENV.prepend "LDFLAGS", "-L#{python_prefix}/lib" unless ARGV.include? "--without-python" + ENV.prepend "LDFLAGS", "-L#{python_prefix}/lib" unless build.include? "without-python" # Fix linker error; see: http://trac.macports.org/ticket/25012 ENV.append "LDFLAGS", "-lintl" # Reset ARCHFLAGS to match how we build @@ -66,12 +71,13 @@ class Fontforge < Formula # 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 inreplace %w(fontforge/macbinary.c fontforge/startui.c gutils/giomime.c) do |s| - if MacOS.lion? - s.gsub! "/Developer", "#{MacOS::sdk_path("10.7")}/Developer" - else - s.gsub! "/Developer", MacOS::Xcode.prefix - end + s.gsub! "/Developer", header_prefix end system "make" @@ -100,7 +106,7 @@ class Fontforge < Formula EOS s = general_caveats - s += python_caveats unless ARGV.include? "--without-python" + s += python_caveats unless build.include? "without-python" return s end end |
