-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
amc-pango.rb
97 lines (88 loc) · 2.94 KB
/
amc-pango.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Vendor Pango because of a 'bug' unidentified.
# https://github.com/maelvls/homebrew-amc/issues/33
# https://project.auto-multiple-choice.net/boards/4/topics/8855?r=8904#message-8904
class AmcPango < Formula
desc "(vendored) Framework for layout and rendering of i18n text"
homepage "https://www.pango.org/"
url "https://download.gnome.org/sources/pango/1.42/pango-1.42.4.tar.xz"
sha256 "1d2b74cd63e8bd41961f2f8d952355aa0f9be6002b52c8aa7699d9f5da597c9d"
revision 2
bottle do
root_url "https://github.com/maelvls/homebrew-amc/releases/download/amc-pango-1.42.4_2"
sha256 big_sur: "f368cc6c6e45310d77104f6ea070dfef663a08a8de2fde0ed203d25f5e24b1bc"
sha256 catalina: "e44ae5b473c17c5ecbfabb38aa6c8648f3d81938eddddaf9b0728d92de685038"
end
head do
url "https://gitlab.gnome.org/GNOME/pango.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gtk-doc" => :build
depends_on "libtool" => :build
end
keg_only "vendored version of Homebrew's pango"
depends_on "gobject-introspection" => :build
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "fontconfig"
depends_on "fribidi"
depends_on "glib"
depends_on "harfbuzz"
def install
system "./autogen.sh" if build.head?
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-html-dir=#{share}/doc",
"--enable-introspection=yes",
"--enable-static",
"--without-xft"
system "make"
system "make", "install"
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"]
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#{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