class Vte3 < Formula desc "Terminal emulator widget used by GNOME terminal" homepage "https://developer.gnome.org/vte/" url "https://download.gnome.org/sources/vte/0.50/vte-0.50.1.tar.xz" sha256 "cf1708e3e573160e1db107014b3ef70888fefe6b668373fed70e8d1cac45a8c2" bottle do sha256 "aef370f70dc0be9784f7f3a27c8b9227984bf11decea9588d5ca20848c49b3e0" => :high_sierra sha256 "18c6bd3fd21bb86e250e970b4c7b2ec86746237fd409347141df5c55db5f350b" => :sierra sha256 "3a4ed053662741acec0afaacfd312a4e001614ae864accf4ec7b2c4de7877194" => :el_capitan end depends_on "pkg-config" => :build depends_on "intltool" => :build depends_on "gettext" depends_on "gtk+3" depends_on "gnutls" depends_on "vala" depends_on "gobject-introspection" depends_on "pcre2" # patch taken from https://bugzilla.gnome.org/show_bug.cgi?id=788476 patch do url "https://raw.githubusercontent.com/Homebrew/formula-patches/6ce03e3/vte3/fix-strchrnul.patch" sha256 "ea498b8233e643defda58f48d6bbadc5d334b931c0a2cf73bddc8ae222e9520e" end def install args = [ "--disable-dependency-tracking", "--prefix=#{prefix}", "--disable-Bsymbolic", "--enable-introspection=yes", "--enable-gnome-pty-helper", ] system "./configure", *args system "make", "install" end test do (testpath/"test.c").write <<~EOS #include int main(int argc, char *argv[]) { guint v = vte_get_major_version(); return 0; } EOS atk = Formula["atk"] cairo = Formula["cairo"] fontconfig = Formula["fontconfig"] freetype = Formula["freetype"] gdk_pixbuf = Formula["gdk-pixbuf"] gettext = Formula["gettext"] glib = Formula["glib"] gnutls = Formula["gnutls"] gtkx3 = Formula["gtk+3"] libepoxy = Formula["libepoxy"] libpng = Formula["libpng"] libtasn1 = Formula["libtasn1"] nettle = Formula["nettle"] 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#{gnutls.opt_include} -I#{gtkx3.opt_include}/gtk-3.0 -I#{include}/vte-2.91 -I#{libepoxy.opt_include} -I#{libpng.opt_include}/libpng16 -I#{libtasn1.opt_include} -I#{nettle.opt_include} -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#{gnutls.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 -lgnutls -lgobject-2.0 -lgtk-3 -lintl -lpango-1.0 -lpangocairo-1.0 -lvte-2.91 -lz ] system ENV.cc, "test.c", "-o", "test", *flags system "./test" end end