Created
March 27, 2012 06:10
-
-
Save kimikato/2213170 to your computer and use it in GitHub Desktop.
the Formula of 'FontForge' for Xcode 4.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Fontforge < Formula | |
url 'http://downloads.sourceforge.net/project/fontforge/fontforge-source/fontforge_full-20110222.tar.bz2' | |
head 'git://fontforge.git.sourceforge.net/gitroot/fontforge/fontforge' | |
homepage 'http://fontforge.sourceforge.net' | |
md5 '5be4dda345b5d73a27cc399df96e463a' | |
depends_on 'pkg-config' => :build | |
depends_on 'gettext' | |
depends_on 'pango' | |
depends_on 'potrace' | |
def options | |
[['--without-python', 'Build without Python.']] | |
end | |
def patches | |
p0 = [] | |
# for Xcode 4.3 | |
p0 << "https://raw.github.com/gist/2212620/cff0bc4c670feed2f5988f8845a5038bacf3790a/fontforge-xcode4.3.patch" | |
return {:p0 => p0} | |
end | |
fails_with :llvm do | |
build 2336 | |
cause "Compiling cvexportdlg.c fails with error: initializer element is not constant" | |
end | |
def install | |
args = ["--prefix=#{prefix}", "--enable-double", "--without-freetype-bytecode"] | |
args << "--without-python" if ARGV.include? "--without-python" | |
ENV.x11 | |
# Fix linker error; see: http://trac.macports.org/ticket/25012 | |
ENV.append "LDFLAGS", "-lintl" | |
system "./configure", *args | |
# Fix hard-coded install locations that don't respect the target bindir | |
inreplace "Makefile" do |s| | |
s.gsub! "/Applications", "$(prefix)" | |
s.gsub! "ln -s /usr/local/bin/fontforge", "ln -s $(bindir)/fontforge" | |
end | |
# Fix hard-coded Xcode path | |
inreplace ["./fontforge/macbinary.c", "./fontforge/startui.c", "./gutils/giomime.c"] do |s| | |
s.gsub! "@@DEVDIR@@", MacOS.xcode_prefix | |
end | |
system "make" | |
system "make install" | |
end | |
def caveats; <<-EOS.undent | |
fontforge is an X11 application. | |
To install the Mac OS X wrapper application run: | |
brew linkapps | |
or: | |
ln -s #{prefix}/FontForge.app /Applications | |
EOS | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment