2011-03-10 05:11:03 +00:00
|
|
|
class Fontforge < Formula
|
2015-08-26 00:05:53 +00:00
|
|
|
desc "Command-line outline and bitmap font editor/converter"
|
2014-09-24 15:02:30 +00:00
|
|
|
homepage "https://fontforge.github.io"
|
2015-08-26 00:05:53 +00:00
|
|
|
url "https://github.com/fontforge/fontforge/archive/20150824.tar.gz"
|
|
|
|
sha256 "28ab2471cb010c1fa75b8ab8191a1dded81fe1e9490aa5ff6ab4706a4c78ff27"
|
2015-02-26 21:59:03 +00:00
|
|
|
head "https://github.com/fontforge/fontforge.git"
|
2013-09-20 15:15:54 +00:00
|
|
|
|
2015-06-17 19:04:01 +00:00
|
|
|
bottle do
|
2015-08-29 00:58:40 +00:00
|
|
|
revision 1
|
2015-09-13 19:35:34 +00:00
|
|
|
sha256 "2a1087da08797e0c61290551b71bbb1abe3d407af53a85700c38897fd9d7951f" => :el_capitan
|
2015-08-29 00:58:40 +00:00
|
|
|
sha256 "f8228c12d9bcda768334b32b51251edd9c970e6a6f213896b7d74e8dfa96231d" => :yosemite
|
|
|
|
sha256 "b303e97388537aa75f15e4f9f16d84470b4f6fa9aaa2b2cb151a6b288903886c" => :mavericks
|
|
|
|
sha256 "065e2c82a000ed3d07f6ac8edc41b530b99f81b10c42442b3887daa5007223cb" => :mountain_lion
|
2015-06-17 19:04:01 +00:00
|
|
|
end
|
|
|
|
|
2015-02-26 21:59:03 +00:00
|
|
|
option "with-giflib", "Build with GIF support"
|
2015-05-14 00:49:31 +00:00
|
|
|
option "with-extra-tools", "Build with additional font tools"
|
2015-02-26 21:59:03 +00:00
|
|
|
|
2014-11-13 18:08:06 +00:00
|
|
|
deprecated_option "with-gif" => "with-giflib"
|
2014-11-13 18:08:06 +00:00
|
|
|
|
2014-10-14 14:45:57 +00:00
|
|
|
# Autotools are required to build from source in all releases.
|
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-10-14 14:45:57 +00:00
|
|
|
depends_on "cairo"
|
2014-12-31 11:52:01 +00:00
|
|
|
depends_on "libpng" => :recommended
|
|
|
|
depends_on "jpeg" => :recommended
|
|
|
|
depends_on "libtiff" => :recommended
|
|
|
|
depends_on "giflib" => :optional
|
|
|
|
depends_on "libspiro" => :optional
|
2014-10-14 14:45:57 +00:00
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
2011-06-13 22:06:03 +00:00
|
|
|
|
2015-03-31 15:38:19 +00:00
|
|
|
# This may be causing font-display glitches and needs further isolation & fixing.
|
|
|
|
# https://github.com/fontforge/fontforge/issues/2083
|
|
|
|
# https://github.com/Homebrew/homebrew/issues/37803
|
|
|
|
depends_on "fontconfig"
|
|
|
|
|
2015-06-18 06:01:51 +00:00
|
|
|
resource "gnulib" do
|
|
|
|
url "git://git.savannah.gnu.org/gnulib.git",
|
|
|
|
:revision => "9a417cf7d48fa231c937c53626da6c45d09e6b3e"
|
|
|
|
end
|
|
|
|
|
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
|
2015-06-18 06:02:55 +00:00
|
|
|
# Don't link libraries to libpython, but do link binaries that expect
|
|
|
|
# to embed a python interpreter
|
|
|
|
# https://github.com/fontforge/fontforge/issues/2353#issuecomment-121009759
|
|
|
|
ENV["PYTHON_CFLAGS"] = `python-config --cflags`.chomp
|
|
|
|
ENV["PYTHON_LIBS"] = "-undefined dynamic_lookup"
|
|
|
|
python_libs = `python2.7-config --ldflags`.chomp
|
|
|
|
inreplace "fontforgeexe/Makefile.am" do |s|
|
|
|
|
oldflags = s.get_make_var "libfontforgeexe_la_LDFLAGS"
|
|
|
|
s.change_make_var! "libfontforgeexe_la_LDFLAGS", "#{python_libs} #{oldflags}"
|
2015-03-31 15:38:19 +00:00
|
|
|
end
|
|
|
|
|
2015-06-18 06:02:55 +00:00
|
|
|
# Disable Homebrew detection
|
|
|
|
# https://github.com/fontforge/fontforge/issues/2425
|
|
|
|
inreplace "configure.ac", 'test "y$HOMEBREW_BREW_FILE" != "y"', "false"
|
|
|
|
|
2014-12-31 11:52:01 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--disable-silent-rules
|
|
|
|
--disable-dependency-tracking
|
2015-06-18 06:02:55 +00:00
|
|
|
--with-pythonbinary=#{which "python2.7"}
|
2015-05-18 16:01:05 +00:00
|
|
|
--without-x
|
2014-12-31 11:52:01 +00:00
|
|
|
]
|
|
|
|
|
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
|
|
|
|
2015-03-31 15:38:19 +00:00
|
|
|
# Fix linker error; see: https://trac.macports.org/ticket/25012
|
2011-03-13 18:13:53 +00:00
|
|
|
ENV.append "LDFLAGS", "-lintl"
|
2013-01-21 09:33:56 +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-12-31 11:52:01 +00:00
|
|
|
# Bootstrap in every build: https://github.com/fontforge/fontforge/issues/1806
|
2015-06-18 06:01:51 +00:00
|
|
|
resource("gnulib").fetch
|
2015-07-17 00:35:25 +00:00
|
|
|
system "./bootstrap",
|
|
|
|
"--gnulib-srcdir=#{resource("gnulib").cached_download}",
|
|
|
|
"--skip-git"
|
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"
|
2015-05-14 00:49:31 +00:00
|
|
|
|
2015-08-28 23:49:01 +00:00
|
|
|
# The app here is not functional. You should install Fontforge
|
|
|
|
# via the Cask if you want GUI/App support.
|
|
|
|
(share/"fontforge/osx/FontForge.app").rmtree
|
|
|
|
|
2015-05-14 00:49:31 +00:00
|
|
|
if build.with? "extra-tools"
|
|
|
|
cd "contrib/fonttools" do
|
|
|
|
system "make"
|
|
|
|
bin.install Dir["*"].select { |f| File.executable? f }
|
|
|
|
end
|
|
|
|
end
|
2010-01-22 05:12:17 +00:00
|
|
|
end
|
|
|
|
|
2013-09-16 01:16:31 +00:00
|
|
|
test do
|
2015-02-26 21:59:03 +00:00
|
|
|
system bin/"fontforge", "-version"
|
2015-06-18 06:02:55 +00:00
|
|
|
system "python", "-c", "import fontforge"
|
2013-03-03 20:36:34 +00:00
|
|
|
end
|
2010-01-22 05:12:17 +00:00
|
|
|
end
|