homebrew-core/Formula/harfbuzz.rb
2015-11-27 01:09:42 +00:00

62 lines
2 KiB
Ruby

class Harfbuzz < Formula
desc "OpenType text shaping engine"
homepage "https://wiki.freedesktop.org/www/Software/HarfBuzz/"
url "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.1.1.tar.bz2"
sha256 "0c366a77276fa69d40006cf8a2f2dbcd82f3fb406f3960c3c3a0d34dd3a0f06c"
revision 1
head do
url "https://github.com/behdad/harfbuzz.git"
depends_on "ragel" => :build
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
bottle do
sha256 "56371f558b86488b2474f46496121a1fa96e233d04e40fd9d5de5f76ae3fcea8" => :el_capitan
sha256 "9187d69eb18a7e6de6370c8ddeed0f4f59b3383cc48b56e4eadd869e7a3703c1" => :yosemite
sha256 "82f65be8b237e44738a145cf62897e0e77bed07f5c2f52558b2a5789a8551d97" => :mavericks
end
option "with-cairo", "Build command-line utilities that depend on Cairo"
depends_on "pkg-config" => :build
depends_on "glib"
depends_on "freetype"
depends_on "gobject-introspection"
depends_on "icu4c" => :recommended
depends_on "cairo" => :optional
depends_on "graphite2" => :optional
resource "ttf" do
url "https://github.com/behdad/harfbuzz/raw/fc0daafab0336b847ac14682e581a8838f36a0bf/test/shaping/fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf"
sha256 "9535d35dab9e002963eef56757c46881f6b3d3b27db24eefcc80929781856c77"
end
def install
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--enable-introspection=yes
--with-gobject=yes
--with-coretext=yes
]
args << "--with-icu" if build.with? "icu4c"
args << "--with-graphite2" if build.with? "graphite2"
args << "--with-cairo" if build.with? "cairo"
system "./autogen.sh" if build.head?
system "./configure", *args
system "make", "install"
end
test do
resource("ttf").stage do
shape = `echo 'സ്റ്റ്' | #{bin}/hb-shape 270b89df543a7e48e206a2d830c0e10e5265c630.ttf`.chomp
assert_equal "[glyph201=0+1183|U0D4D=0+0]", shape
end
end
end