88 lines
2.5 KiB
Ruby
88 lines
2.5 KiB
Ruby
class Pango < Formula
|
|
desc "Framework for layout and rendering of i18n text"
|
|
homepage "https://www.pango.org/"
|
|
url "https://download.gnome.org/sources/pango/1.44/pango-1.44.3.tar.xz"
|
|
sha256 "290bb100ca5c7025ec3f97332eaf783b76ba1f444110f06ac5ee3285e3e5aece"
|
|
|
|
bottle do
|
|
sha256 "bbe2356a992aeb8ee3eabc6f324b977064ab2a1e55f6790868e195e5e0ed9e38" => :mojave
|
|
sha256 "825221fbc32395b761a76db33c75e56c114a51708af01d475b295f7fd37c3148" => :high_sierra
|
|
sha256 "500e9db4d0136d28d513acf860c5cbaaae3bd03f92c1899b4bdcf28bd3abd8dd" => :sierra
|
|
end
|
|
|
|
head do
|
|
url "https://gitlab.gnome.org/GNOME/pango.git"
|
|
end
|
|
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "meson" => :build
|
|
depends_on "ninja" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "cairo"
|
|
depends_on "fontconfig"
|
|
depends_on "fribidi"
|
|
depends_on "glib"
|
|
depends_on "harfbuzz"
|
|
|
|
def install
|
|
mkdir "build" do
|
|
system "meson", "--prefix=#{prefix}",
|
|
"-Ddefault_library=both",
|
|
"-Dintrospection=true",
|
|
"-Duse_fontconfig=true",
|
|
".."
|
|
system "ninja", "-v"
|
|
system "ninja", "install", "-v"
|
|
end
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/pango-view", "--version"
|
|
(testpath/"test.c").write <<~EOS
|
|
#include <pango/pangocairo.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
PangoFontMap *fontmap;
|
|
int n_families;
|
|
PangoFontFamily **families;
|
|
fontmap = pango_cairo_font_map_get_default();
|
|
pango_font_map_list_families (fontmap, &families, &n_families);
|
|
g_free(families);
|
|
return 0;
|
|
}
|
|
EOS
|
|
cairo = Formula["cairo"]
|
|
fontconfig = Formula["fontconfig"]
|
|
freetype = Formula["freetype"]
|
|
gettext = Formula["gettext"]
|
|
glib = Formula["glib"]
|
|
harfbuzz = Formula["harfbuzz"]
|
|
libpng = Formula["libpng"]
|
|
pixman = Formula["pixman"]
|
|
flags = %W[
|
|
-I#{cairo.opt_include}/cairo
|
|
-I#{fontconfig.opt_include}
|
|
-I#{freetype.opt_include}/freetype2
|
|
-I#{gettext.opt_include}
|
|
-I#{glib.opt_include}/glib-2.0
|
|
-I#{glib.opt_lib}/glib-2.0/include
|
|
-I#{harfbuzz.opt_include}/harfbuzz
|
|
-I#{include}/pango-1.0
|
|
-I#{libpng.opt_include}/libpng16
|
|
-I#{pixman.opt_include}/pixman-1
|
|
-D_REENTRANT
|
|
-L#{cairo.opt_lib}
|
|
-L#{gettext.opt_lib}
|
|
-L#{glib.opt_lib}
|
|
-L#{lib}
|
|
-lcairo
|
|
-lglib-2.0
|
|
-lgobject-2.0
|
|
-lintl
|
|
-lpango-1.0
|
|
-lpangocairo-1.0
|
|
]
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|