76 lines
2.2 KiB
Ruby
76 lines
2.2 KiB
Ruby
class Harfbuzz < Formula
|
|
desc "OpenType text shaping engine"
|
|
homepage "https://wiki.freedesktop.org/www/Software/HarfBuzz/"
|
|
url "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.8.2.tar.bz2"
|
|
sha256 "c8a3f88f416185a82f899a68b5714d6a40d7dc4d1d7379057348918d55aac657"
|
|
|
|
bottle do
|
|
sha256 "1a4ac71fdedb66d25edf080a5ae642646b4582642445f6f3a335990aaa92850b" => :high_sierra
|
|
sha256 "0a7f4f36acbe892cbe3d2c42efb1d4cbe2c70f7adf54d595c06163e5eaa3c7d8" => :sierra
|
|
sha256 "96c8da5bdb20cc16fbce6f977c6ebb2dd59c78e29ccb57cb359c8376421f0dfa" => :el_capitan
|
|
end
|
|
|
|
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
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "freetype" => :recommended
|
|
depends_on "graphite2" => :recommended
|
|
depends_on "icu4c" => :recommended
|
|
depends_on "cairo"
|
|
depends_on "glib"
|
|
|
|
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}
|
|
--with-coretext=yes
|
|
--enable-static
|
|
--with-cairo=yes
|
|
--with-glib=yes
|
|
--with-gobject=yes
|
|
--enable-introspection=yes
|
|
]
|
|
|
|
if build.with? "freetype"
|
|
args << "--with-freetype=yes"
|
|
else
|
|
args << "--with-freetype=no"
|
|
end
|
|
|
|
if build.with? "graphite2"
|
|
args << "--with-graphite2=yes"
|
|
else
|
|
args << "--with-graphite2=no"
|
|
end
|
|
|
|
if build.with? "icu4c"
|
|
args << "--with-icu=yes"
|
|
else
|
|
args << "--with-icu=no"
|
|
end
|
|
|
|
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
|