homebrew-core/Formula/fontconfig.rb
2017-09-15 10:22:26 +02:00

67 lines
2.2 KiB
Ruby

class Fontconfig < Formula
desc "XML-based font configuration API for X Windows"
homepage "https://wiki.freedesktop.org/www/Software/fontconfig/"
url "https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.5.tar.bz2"
sha256 "e10ccf1e26b0968f61d81037af1147fea28e86bfd159ffd8cfd5a486da126ce4"
# The bottle tooling is too lenient and thinks fontconfig
# is relocatable, but it has hardcoded paths in the executables.
bottle do
sha256 "ac955861745381f7a18702e7788324e7feeac3ee5bba6423b307b8275b447953" => :high_sierra
sha256 "a80b7f56acfff0602433d4bad7306d8ab8bc88fd28331682154abed4b8dcc910" => :sierra
sha256 "fa6975258d80fcb0bd4227c01d3b0d6b6c9aa3b494c58e9f8120f91c9714e2dd" => :el_capitan
end
pour_bottle? do
reason "The bottle needs to be installed into /usr/local."
# c.f. the identical hack in lua
# https://github.com/Homebrew/homebrew/issues/47173
satisfy { HOMEBREW_PREFIX.to_s == "/usr/local" }
end
head do
url "https://anongit.freedesktop.org/git/fontconfig", :using => :git
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
keg_only :provided_pre_mountain_lion
depends_on "pkg-config" => :build
depends_on "freetype"
def install
font_dirs = %w[
/System/Library/Fonts
/Library/Fonts
~/Library/Fonts
]
if MacOS.version == :sierra
font_dirs << "/System/Library/Assets/com_apple_MobileAsset_Font3"
elsif MacOS.version == :high_sierra
font_dirs << "/System/Library/Assets/com_apple_MobileAsset_Font4"
end
system "autoreconf", "-iv" if build.head?
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--enable-static",
"--with-add-fonts=#{font_dirs.join(",")}",
"--prefix=#{prefix}",
"--localstatedir=#{var}",
"--sysconfdir=#{etc}"
system "make", "install", "RUN_FC_CACHE_TEST=false"
end
def post_install
ohai "Regenerating font cache, this may take a while"
system "#{bin}/fc-cache", "-frv"
end
test do
system "#{bin}/fc-list"
end
end