93 lines
2.8 KiB
Ruby
93 lines
2.8 KiB
Ruby
class Gtksourceview3 < Formula
|
|
desc "Text view with syntax, undo/redo, and text marks"
|
|
homepage "https://projects.gnome.org/gtksourceview/"
|
|
url "https://download.gnome.org/sources/gtksourceview/3.24/gtksourceview-3.24.8.tar.xz"
|
|
sha256 "1e9bb8ff190db705deb916dd23ff681f0e8803aec407bf0fd64c7e615ac436fe"
|
|
|
|
bottle do
|
|
sha256 "d5ed85f5101162340ef98fa308edd20e33d90fb76a5b953688b01375886891e6" => :mojave
|
|
sha256 "b9aaaf43cb1cc013e52eb93191aa16499fe3aa5581865f73877ab6a25326b9ad" => :high_sierra
|
|
sha256 "e4d274ab1cf152b852a5d7a3143c5e316ee9a578ca0cb30e4b2127c61c4b3cad" => :sierra
|
|
sha256 "8927249142c072a094169141c40eb79a11083d1478edd7f756d58d97a92d7ebd" => :el_capitan
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "vala" => :build
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "intltool" => :build
|
|
depends_on "gettext"
|
|
depends_on "gtk+3"
|
|
|
|
def install
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--enable-vala=yes",
|
|
"--enable-introspection=yes",
|
|
"--prefix=#{prefix}"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~EOS
|
|
#include <gtksourceview/gtksourceview.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
gchar *text = gtk_source_utils_unescape_search_text("hello world");
|
|
return 0;
|
|
}
|
|
EOS
|
|
ENV.libxml2
|
|
atk = Formula["atk"]
|
|
cairo = Formula["cairo"]
|
|
fontconfig = Formula["fontconfig"]
|
|
freetype = Formula["freetype"]
|
|
gdk_pixbuf = Formula["gdk-pixbuf"]
|
|
gettext = Formula["gettext"]
|
|
glib = Formula["glib"]
|
|
gtkx3 = Formula["gtk+3"]
|
|
libepoxy = Formula["libepoxy"]
|
|
libpng = Formula["libpng"]
|
|
pango = Formula["pango"]
|
|
pixman = Formula["pixman"]
|
|
flags = %W[
|
|
-I#{atk.opt_include}/atk-1.0
|
|
-I#{cairo.opt_include}/cairo
|
|
-I#{fontconfig.opt_include}
|
|
-I#{freetype.opt_include}/freetype2
|
|
-I#{gdk_pixbuf.opt_include}/gdk-pixbuf-2.0
|
|
-I#{gettext.opt_include}
|
|
-I#{glib.opt_include}/gio-unix-2.0/
|
|
-I#{glib.opt_include}/glib-2.0
|
|
-I#{glib.opt_lib}/glib-2.0/include
|
|
-I#{gtkx3.opt_include}/gtk-3.0
|
|
-I#{include}/gtksourceview-3.0
|
|
-I#{libepoxy.opt_include}
|
|
-I#{libpng.opt_include}/libpng16
|
|
-I#{pango.opt_include}/pango-1.0
|
|
-I#{pixman.opt_include}/pixman-1
|
|
-D_REENTRANT
|
|
-L#{atk.opt_lib}
|
|
-L#{cairo.opt_lib}
|
|
-L#{gdk_pixbuf.opt_lib}
|
|
-L#{gettext.opt_lib}
|
|
-L#{glib.opt_lib}
|
|
-L#{gtkx3.opt_lib}
|
|
-L#{lib}
|
|
-L#{pango.opt_lib}
|
|
-latk-1.0
|
|
-lcairo
|
|
-lcairo-gobject
|
|
-lgdk-3
|
|
-lgdk_pixbuf-2.0
|
|
-lgio-2.0
|
|
-lglib-2.0
|
|
-lgobject-2.0
|
|
-lgtk-3
|
|
-lgtksourceview-3.0
|
|
-lintl
|
|
-lpango-1.0
|
|
-lpangocairo-1.0
|
|
]
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|