Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
gobject-introspection: python3 requires head
Browse files Browse the repository at this point in the history
  • Loading branch information
moyogo committed Oct 31, 2015
1 parent 32a59ac commit 40b7ced
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions Library/Formula/gobject-introspection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class GobjectIntrospection < Formula
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on :python3 => :optional
end

bottle do
Expand All @@ -35,19 +36,34 @@ 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
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libffi"].opt_lib/"pkgconfig"
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

0 comments on commit 40b7ced

Please sign in to comment.