diff --git a/Library/Formula/gobject-introspection.rb b/Library/Formula/gobject-introspection.rb index ced2d58784e7..0e2986252b97 100644 --- a/Library/Formula/gobject-introspection.rb +++ b/Library/Formula/gobject-introspection.rb @@ -4,6 +4,15 @@ class GobjectIntrospection < Formula url "https://download.gnome.org/sources/gobject-introspection/1.46/gobject-introspection-1.46.0.tar.xz" sha256 "6658bd3c2b8813eb3e2511ee153238d09ace9d309e4574af27443d87423e4233" + head do + url "https://github.com/GNOME/gobject-introspection.git" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + depends_on :python3 => :optional + end + bottle do sha256 "8cc016da6173e849904b707d9183f77078770bcda5db26838c28808b18b93dc0" => :el_capitan sha256 "55644f76743a7d0ff9536876272ad3de9c40fe13e411fb34ccec0f4d4536c96f" => :yosemite @@ -27,13 +36,25 @@ def install ENV["GI_SCANNER_DISABLE_CACHE"] = "true" ENV.universal_binary if build.universal? inreplace "giscanner/transformer.py", "/usr/share", "#{HOMEBREW_PREFIX}/share" - inreplace "configure" do |s| - s.change_make_var! "GOBJECT_INTROSPECTION_LIBDIR", "#{HOMEBREW_PREFIX}/lib" - end - system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" - system "make" - system "make", "install" + if build.head? + Language::Python.each_python(build) do |python, _version| + system "./autogen.sh" + inreplace "configure" do |s| + s.change_make_var! "GOBJECT_INTROSPECTION_LIBDIR", "#{HOMEBREW_PREFIX}/lib" + end + system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "PYTHON=#{python}" + system "make" + system "make", "install" + end + else + inreplace "configure" do |s| + s.change_make_var! "GOBJECT_INTROSPECTION_LIBDIR", "#{HOMEBREW_PREFIX}/lib" + end + system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "PYTHON=#{python}" + system "make" + system "make", "install" + end end test do @@ -41,5 +62,8 @@ def install resource("tutorial").stage testpath system "make" assert (testpath/"Tut-0.1.typelib").exist? + Language::Python.each_python(build) do |python, _version| + system python, "-c", "import gi" + end end end