homebrew-core/Formula/harfbuzz.rb

57 lines
1.7 KiB
Ruby

class Harfbuzz < Formula
desc "OpenType text shaping engine"
homepage "https://github.com/harfbuzz/harfbuzz"
url "https://github.com/harfbuzz/harfbuzz/archive/2.7.2.tar.gz"
sha256 "8ec112ee108642477478b75fc7906422abed404d7530e47ba0a4875f553f1b59"
license "MIT"
head "https://github.com/harfbuzz/harfbuzz.git"
bottle do
cellar :any
sha256 "daeed137364e3e37450e763fafb14fdd53bd4cd2bdd93b579392947f7d5b7ea3" => :catalina
sha256 "938b10d5b93eea376f6dad45c0291af8d37cf2ab76cc98cd5b2e01457ab7f642" => :mojave
sha256 "ace431a79de604e58a5998b5d59f9aa95769e3ba6851dead56cfbe63bfd61379" => :high_sierra
end
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "cairo"
depends_on "freetype"
depends_on "glib"
depends_on "gobject-introspection"
depends_on "graphite2"
depends_on "icu4c"
resource "ttf" do
url "https://github.com/harfbuzz/harfbuzz/raw/fc0daafab0336b847ac14682e581a8838f36a0bf/test/shaping/fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf"
sha256 "9535d35dab9e002963eef56757c46881f6b3d3b27db24eefcc80929781856c77"
end
def install
args = %w[
--default-library=both
-Dcairo=enabled
-Dcoretext=enabled
-Dfreetype=enabled
-Dglib=enabled
-Dgobject=enabled
-Dgraphite=enabled
-Dicu=enabled
-Dintrospection=enabled
]
mkdir "build" do
system "meson", *std_meson_args, *args, ".."
system "ninja"
system "ninja", "install"
end
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