2010-01-22 05:12:17 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Fontforge < Formula
|
2013-02-23 18:20:10 +00:00
|
|
|
homepage 'http://fontforge.org/'
|
2014-03-23 02:51:41 +00:00
|
|
|
revision 1
|
2010-01-22 05:12:17 +00:00
|
|
|
|
2013-09-20 15:15:54 +00:00
|
|
|
stable do
|
2014-02-27 14:19:55 +00:00
|
|
|
url 'https://downloads.sourceforge.net/project/fontforge/fontforge-source/fontforge_full-20120731-b.tar.bz2'
|
2013-09-20 15:15:54 +00:00
|
|
|
sha1 'b520f532b48e557c177dffa29120225066cc4e84'
|
|
|
|
|
|
|
|
depends_on 'cairo' => :optional
|
|
|
|
depends_on 'pango' => :optional
|
2014-03-14 02:42:11 +00:00
|
|
|
|
|
|
|
# Fixes double defined AnchorPoint on Mountain Lion 10.8.2
|
|
|
|
patch do
|
2014-04-26 19:48:32 +00:00
|
|
|
url "https://gist.githubusercontent.com/rubenfonseca/5078149/raw/98a812df4e8c50d5a639877bc2d241e5689f1a14/fontforge"
|
2014-03-14 02:42:11 +00:00
|
|
|
sha1 "baa7d60f4c6e672180e66438ee675b4ee0fda5ce"
|
|
|
|
end
|
2013-09-20 15:15:54 +00:00
|
|
|
end
|
|
|
|
|
2014-05-15 19:07:39 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "62e19f688ec4fbd4a6263c6187980c35521a7b40" => :mavericks
|
|
|
|
sha1 "5edf50ab049d44ff399defe673faa58d136c54d3" => :mountain_lion
|
|
|
|
sha1 "8b38be9b20ce239e63f3f3009482ab8f130c0a33" => :lion
|
|
|
|
end
|
|
|
|
|
2013-09-20 15:15:54 +00:00
|
|
|
head do
|
|
|
|
url 'https://github.com/fontforge/fontforge.git'
|
|
|
|
|
2014-06-02 02:38:17 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2013-09-20 15:15:54 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
|
|
|
depends_on 'glib'
|
|
|
|
depends_on 'pango'
|
|
|
|
depends_on 'cairo'
|
2013-10-02 11:25:28 +00:00
|
|
|
depends_on 'ossp-uuid'
|
2013-09-20 15:15:54 +00:00
|
|
|
end
|
2012-03-06 03:57:10 +00:00
|
|
|
|
2013-06-03 22:34:03 +00:00
|
|
|
option 'with-gif', 'Build with GIF support'
|
2013-11-12 15:08:57 +00:00
|
|
|
option 'with-x', 'Build with X11 support, including FontForge.app'
|
2012-09-02 08:03:05 +00:00
|
|
|
|
2010-01-22 05:12:17 +00:00
|
|
|
depends_on 'gettext'
|
2014-05-08 17:21:44 +00:00
|
|
|
depends_on :python => :optional
|
2010-01-22 05:12:17 +00:00
|
|
|
|
2014-03-23 02:51:41 +00:00
|
|
|
depends_on 'libpng' => :recommended
|
2012-11-12 05:37:21 +00:00
|
|
|
depends_on 'jpeg' => :recommended
|
|
|
|
depends_on 'libtiff' => :recommended
|
2013-06-03 22:34:03 +00:00
|
|
|
depends_on :x11 if build.with? 'x'
|
2013-02-02 23:52:43 +00:00
|
|
|
depends_on 'giflib' if build.with? 'gif'
|
|
|
|
depends_on 'libspiro' => :optional
|
2013-09-16 01:16:31 +00:00
|
|
|
depends_on 'czmq'=> :optional
|
2013-01-21 09:33:56 +00:00
|
|
|
depends_on 'fontconfig'
|
2011-06-13 22:06:03 +00:00
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2336
|
|
|
|
cause "Compiling cvexportdlg.c fails with error: initializer element is not constant"
|
|
|
|
end
|
2011-03-13 18:13:53 +00:00
|
|
|
|
2011-03-21 21:24:22 +00:00
|
|
|
def install
|
2012-03-06 03:57:10 +00:00
|
|
|
args = ["--prefix=#{prefix}",
|
|
|
|
"--enable-double",
|
|
|
|
"--without-freetype-bytecode"]
|
|
|
|
|
2013-09-16 01:16:31 +00:00
|
|
|
unless build.head?
|
|
|
|
# These are optional in the stable release, but required in head
|
|
|
|
args << "--without-cairo" if build.without? "cairo"
|
|
|
|
args << "--without-pango" if build.without? "pango"
|
|
|
|
end
|
2014-03-06 20:40:26 +00:00
|
|
|
args << "--without-x" if build.without? 'x'
|
2013-01-21 09:33:56 +00:00
|
|
|
|
|
|
|
# To avoid "dlopen(/opt/local/lib/libpng.2.dylib, 1): image not found"
|
|
|
|
args << "--with-static-imagelibs"
|
|
|
|
|
|
|
|
if build.with? 'python'
|
2012-05-31 18:13:25 +00:00
|
|
|
args << "--enable-pyextension"
|
2013-01-21 09:33:56 +00:00
|
|
|
# Fix linking to correct Python library
|
2014-01-04 13:05:34 +00:00
|
|
|
ENV.prepend "LDFLAGS", "-L#{%x(python-config --prefix).chomp}/lib"
|
2013-01-21 09:33:56 +00:00
|
|
|
else
|
|
|
|
args << "--without-python"
|
2012-05-31 18:13:25 +00:00
|
|
|
end
|
2011-06-13 22:06:03 +00:00
|
|
|
|
2011-03-13 18:13:53 +00:00
|
|
|
# Fix linker error; see: http://trac.macports.org/ticket/25012
|
|
|
|
ENV.append "LDFLAGS", "-lintl"
|
2013-01-21 09:33:56 +00:00
|
|
|
|
2013-09-16 01:16:31 +00:00
|
|
|
# Add environment variables for system libs if building head
|
|
|
|
if build.head?
|
|
|
|
ENV.append "ZLIB_CFLAGS", "-I/usr/include"
|
|
|
|
ENV.append "ZLIB_LIBS", "-L/usr/lib -lz"
|
|
|
|
end
|
|
|
|
|
2012-05-31 18:13:25 +00:00
|
|
|
# Reset ARCHFLAGS to match how we build
|
2013-08-02 02:46:56 +00:00
|
|
|
ENV["ARCHFLAGS"] = "-arch #{MacOS.preferred_arch}"
|
2012-05-31 18:13:25 +00:00
|
|
|
|
2013-02-17 21:26:09 +00:00
|
|
|
# Set up framework paths so FlatCarbon replacement paths work (see below)
|
2013-01-21 09:33:56 +00:00
|
|
|
ENV.append "CFLAGS", "-F#{MacOS.sdk_path}/System/Library/Frameworks/CoreServices.framework/Frameworks"
|
|
|
|
ENV.append "CFLAGS", "-F#{MacOS.sdk_path}/System/Library/Frameworks/Carbon.framework/Frameworks"
|
2012-09-02 08:03:05 +00:00
|
|
|
|
2013-09-16 01:16:31 +00:00
|
|
|
system "./autogen.sh" if build.head?
|
2011-06-13 22:06:03 +00:00
|
|
|
system "./configure", *args
|
2010-09-09 19:38:22 +00:00
|
|
|
|
2011-07-29 16:05:08 +00:00
|
|
|
# Fix hard-coded install locations that don't respect the target bindir
|
2010-09-09 19:38:22 +00:00
|
|
|
inreplace "Makefile" do |s|
|
|
|
|
s.gsub! "/Applications", "$(prefix)"
|
2011-07-29 16:05:08 +00:00
|
|
|
s.gsub! "ln -s /usr/local/bin/fontforge", "ln -s $(bindir)/fontforge"
|
2010-09-09 19:38:22 +00:00
|
|
|
end
|
|
|
|
|
2012-05-31 18:13:25 +00:00
|
|
|
# Fix install location of Python extension; see:
|
|
|
|
# http://sourceforge.net/mailarchive/message.php?msg_id=26827938
|
|
|
|
inreplace "Makefile" do |s|
|
2014-01-04 13:05:34 +00:00
|
|
|
s.gsub! "python setup.py install --prefix=$(prefix) --root=$(DESTDIR)", "python setup.py install --prefix=$(prefix)"
|
2012-05-31 18:13:25 +00:00
|
|
|
end
|
|
|
|
|
2013-02-17 21:26:09 +00:00
|
|
|
# Replace FlatCarbon headers with the real paths
|
|
|
|
# Fixes building on 10.8
|
2013-12-14 03:55:56 +00:00
|
|
|
# Only needed for non-head build
|
|
|
|
unless build.head?
|
|
|
|
inreplace %w(fontforge/macbinary.c fontforge/startui.c gutils/giomime.c) do |s|
|
|
|
|
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
|
2012-03-06 03:57:10 +00:00
|
|
|
end
|
|
|
|
|
2010-01-22 05:12:17 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
2013-09-16 01:16:31 +00:00
|
|
|
test do
|
|
|
|
system "#{bin}/fontforge", "-version"
|
2013-03-03 20:36:34 +00:00
|
|
|
end
|
2010-01-22 05:12:17 +00:00
|
|
|
end
|