2014-09-24 15:02:30 +00:00
|
|
|
require "formula"
|
2010-01-22 05:12:17 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Fontforge < Formula
|
2014-09-24 15:02:30 +00:00
|
|
|
homepage "https://fontforge.github.io"
|
2014-11-28 01:29:57 +00:00
|
|
|
url "https://github.com/fontforge/fontforge/releases/download/20141126/fontforge-2014-11-26-Unix-Source.tar.gz"
|
2014-11-27 03:17:09 +00:00
|
|
|
sha1 "ecd776480a47cdcbe1b30ce275172d7d52288e77"
|
|
|
|
head "https://github.com/fontforge/fontforge.git"
|
2014-12-08 03:54:48 +00:00
|
|
|
version "20141126"
|
2013-09-20 15:15:54 +00:00
|
|
|
|
2014-05-15 19:07:39 +00:00
|
|
|
bottle do
|
2014-11-27 03:31:11 +00:00
|
|
|
sha1 "9cb3881adf612eae21aa4c70eb17907a96f05d8d" => :yosemite
|
|
|
|
sha1 "a079566b826ae865e2f393eaaa56cdc097d1f458" => :mavericks
|
|
|
|
sha1 "dcb8c5630310b8a7c534e90e4579d2734a0154ab" => :mountain_lion
|
2014-05-15 19:07:39 +00:00
|
|
|
end
|
|
|
|
|
2014-11-13 18:08:06 +00:00
|
|
|
deprecated_option "with-x" => "with-x11"
|
2014-11-13 18:08:06 +00:00
|
|
|
deprecated_option "with-gif" => "with-giflib"
|
2014-11-13 18:08:06 +00:00
|
|
|
|
2014-11-13 18:08:06 +00:00
|
|
|
option "with-giflib", "Build with GIF support"
|
2014-09-24 15:02:30 +00:00
|
|
|
|
2014-10-14 14:45:57 +00:00
|
|
|
# Autotools are required to build from source in all releases.
|
|
|
|
# I have upstreamed a request to change this, so keep monitoring the situation.
|
2014-09-24 15:02:30 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "pkg-config" => :build
|
2014-11-06 02:32:09 +00:00
|
|
|
depends_on "libtool" => :run
|
2014-09-24 15:02:30 +00:00
|
|
|
depends_on "gettext"
|
|
|
|
depends_on "pango"
|
2014-11-27 03:17:09 +00:00
|
|
|
depends_on "zeromq"
|
|
|
|
depends_on "czmq"
|
2014-09-24 15:02:30 +00:00
|
|
|
depends_on "libpng" => :recommended
|
|
|
|
depends_on "jpeg" => :recommended
|
|
|
|
depends_on "libtiff" => :recommended
|
2014-11-13 18:08:06 +00:00
|
|
|
depends_on :x11 => :optional
|
2014-11-27 03:17:09 +00:00
|
|
|
depends_on "gtk+" => :optional
|
2014-11-13 18:08:06 +00:00
|
|
|
depends_on "giflib" => :optional
|
2014-09-24 15:02:30 +00:00
|
|
|
depends_on "libspiro" => :optional
|
|
|
|
depends_on "fontconfig"
|
2014-10-14 14:45:57 +00:00
|
|
|
depends_on "cairo"
|
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
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
|
2014-09-24 15:02:30 +00:00
|
|
|
args = ["--prefix=#{prefix}"]
|
2012-03-06 03:57:10 +00:00
|
|
|
|
2014-11-13 18:08:06 +00:00
|
|
|
args << "--with-x" if build.with? "x11"
|
2014-11-27 03:17:09 +00:00
|
|
|
args << "--enable-gtk2-use" if build.with? "gtk+"
|
2014-10-14 14:45:57 +00:00
|
|
|
|
|
|
|
args << "--without-libpng" if build.without? "libpng"
|
|
|
|
args << "--without-libjpeg" if build.without? "jpeg"
|
|
|
|
args << "--without-libtiff" if build.without? "libtiff"
|
|
|
|
args << "--without-giflib" if build.without? "giflib"
|
|
|
|
args << "--without-libspiro" if build.without? "libspiro"
|
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
|
|
|
|
2014-09-24 15:02:30 +00:00
|
|
|
# Add environment variables for system libs
|
|
|
|
ENV.append "ZLIB_CFLAGS", "-I/usr/include"
|
|
|
|
ENV.append "ZLIB_LIBS", "-L/usr/lib -lz"
|
|
|
|
|
|
|
|
# And finding Homebrew's Python
|
2014-10-14 14:45:57 +00:00
|
|
|
ENV.append_path "PKG_CONFIG_PATH", "#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig/"
|
|
|
|
ENV.prepend "LDFLAGS", "-L#{%x(python-config --prefix).chomp}/lib"
|
2013-09-16 01:16:31 +00:00
|
|
|
|
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
|
|
|
|
2014-10-14 14:45:57 +00:00
|
|
|
# Bootstrap in every build. See the link below.
|
|
|
|
system "./bootstrap" #https://github.com/fontforge/fontforge/issues/1806
|
2011-06-13 22:06:03 +00:00
|
|
|
system "./configure", *args
|
2010-01-22 05:12:17 +00:00
|
|
|
system "make"
|
2014-09-24 15:02:30 +00:00
|
|
|
system "make", "install"
|
|
|
|
|
2014-10-14 14:45:57 +00:00
|
|
|
# Link this to enable symlinking into /Applications with brew linkapps.
|
2014-11-13 17:55:16 +00:00
|
|
|
# The name is case-sensitive. It breaks without both F's capitalised.
|
|
|
|
ln_s "#{share}/fontforge/osx/FontForge.app", prefix
|
2010-01-22 05:12:17 +00:00
|
|
|
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
|