2013-10-19 01:34:08 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pygobject3 < Formula
|
|
|
|
homepage 'http://live.gnome.org/PyGObject'
|
2014-04-03 14:25:42 +00:00
|
|
|
url 'http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.12/pygobject-3.12.0.tar.xz'
|
2014-04-03 03:03:43 +00:00
|
|
|
sha256 '0d4485311fcfb073dc37432e36ad1d45bcf9f8796a1e8ff20a6494e0297dbd1a'
|
2013-10-19 01:34:08 +00:00
|
|
|
|
|
|
|
option 'with-tests', 'run tests'
|
|
|
|
|
|
|
|
depends_on 'pkg-config' => :build
|
|
|
|
|
2014-02-23 01:32:24 +00:00
|
|
|
# these dependencies are not required for `brew test`, but rather for
|
|
|
|
# the tests included with the source code.
|
2013-10-19 01:34:08 +00:00
|
|
|
if build.with? 'tests'
|
|
|
|
depends_on 'automake' => :build
|
|
|
|
depends_on 'autoconf' => :build
|
|
|
|
depends_on 'libtool' => :build
|
|
|
|
depends_on 'gnome-common' => :build
|
|
|
|
depends_on 'gtk+3' => :build
|
|
|
|
end
|
|
|
|
|
|
|
|
depends_on 'libffi' => :optional
|
|
|
|
depends_on 'glib'
|
2014-02-12 02:06:07 +00:00
|
|
|
depends_on :python => :recommended
|
2013-10-19 01:34:08 +00:00
|
|
|
depends_on :python3 => :optional
|
2014-02-12 02:06:07 +00:00
|
|
|
depends_on 'py2cairo' if build.with? 'python'
|
2013-10-19 01:34:08 +00:00
|
|
|
depends_on 'py3cairo' if build.with? 'python3'
|
|
|
|
depends_on 'gobject-introspection'
|
|
|
|
|
|
|
|
option :universal
|
|
|
|
|
2014-03-17 19:43:59 +00:00
|
|
|
patch do
|
|
|
|
url "https://gist.github.com/krrk/6439665/raw/a527e14cd3a77c19b089f27bea884ce46c988f55/pygobject-fix-module.patch"
|
|
|
|
sha1 "1d7aad99256d87d616a41b7026cd05267bd9f97f"
|
|
|
|
end if build.with? 'tests'
|
2013-10-19 01:34:08 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
ENV.universal_binary if build.universal?
|
|
|
|
|
2014-01-04 13:13:49 +00:00
|
|
|
if build.with? 'tests'
|
|
|
|
# autogen.sh is necessary to update the build system after the above
|
|
|
|
# patch and XDG_DATA_DIRS needs to be fixed for some tests to run
|
|
|
|
inreplace 'tests/Makefile.am', '/usr/share', HOMEBREW_PREFIX/'share'
|
|
|
|
system "./autogen.sh"
|
2013-10-19 01:34:08 +00:00
|
|
|
end
|
2014-01-04 13:13:49 +00:00
|
|
|
|
2014-03-08 12:08:10 +00:00
|
|
|
Language::Python.each_python(build) do |python, version|
|
2014-02-27 04:32:22 +00:00
|
|
|
ENV["PYTHON"] = "#{python}" if Formula[python].installed?
|
2014-02-12 02:06:07 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
|
|
|
system "make", "install"
|
|
|
|
system "make", "check" if build.with? 'tests'
|
2014-03-08 12:08:10 +00:00
|
|
|
system "make", "clean"
|
2014-02-12 02:06:07 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
Pathname('test.py').write <<-EOS.undent
|
|
|
|
import gi
|
|
|
|
assert("__init__" in gi.__file__)
|
|
|
|
EOS
|
2014-03-08 12:08:10 +00:00
|
|
|
Language::Python.each_python(build) do |python, version|
|
2014-02-12 02:06:07 +00:00
|
|
|
system python, "test.py"
|
|
|
|
end
|
2013-10-19 01:34:08 +00:00
|
|
|
end
|
|
|
|
end
|