class GobjectIntrospection < Formula desc "Generate introspection data for GObject libraries" homepage "https://live.gnome.org/GObjectIntrospection" url "https://download.gnome.org/sources/gobject-introspection/1.56/gobject-introspection-1.56.0.tar.xz" sha256 "0d7059fad7aa5ec50d9678aea4ea139acab23737e9cf9ca0d86c615cecbaa0f8" bottle do sha256 "bbaedc361807bb187116ca8f5592d01de87407d60d868d097118d2bb635bf76c" => :high_sierra sha256 "b94d571b00bc21c518c9657b224ecf3d6776c5c190e76d7a5dd8bd10a66164d6" => :sierra sha256 "ea7658ae17f9662cdecc3d5251801e027173e17333c7e74570006faf7a6f84e5" => :el_capitan end depends_on "pkg-config" depends_on "glib" depends_on "cairo" depends_on "libffi" depends_on "python@2" if MacOS.version <= :mavericks resource "tutorial" do url "https://gist.github.com/7a0023656ccfe309337a.git", :revision => "499ac89f8a9ad17d250e907f74912159ea216416" end def install ENV["GI_SCANNER_DISABLE_CACHE"] = "true" inreplace "giscanner/transformer.py", "/usr/share", "#{HOMEBREW_PREFIX}/share" inreplace "configure" do |s| s.change_make_var! "GOBJECT_INTROSPECTION_LIBDIR", "#{HOMEBREW_PREFIX}/lib" end python = if MacOS.version >= :yosemite "/usr/bin/python2.7" else Formula["python@2"].opt_bin/"python2.7" end system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-python=#{python}" system "make" system "make", "install" end test do ENV.prepend_path "PKG_CONFIG_PATH", Formula["libffi"].opt_lib/"pkgconfig" resource("tutorial").stage testpath system "make" assert_predicate testpath/"Tut-0.1.typelib", :exist? end end