030793c988
Allow `build.with?` and similar methods to be used during the test phase. The BuildOptions (`build`) are initialized with the `Tab.used_options` unless explicitly overwritten on the command line. So basically `build.with?` works in `def install` and in `test do` as one would naively expect. (For the test, gramatically it should be `built.with?` but who cares) If a formula was installed `--with-python`, now the tests are also run `--with-python`. This enables us to use the `python do ... end` in a meaningful manner. Using `python do ... end` blocks for the tests, because the bot.brew.sh has system python per default and we need to set the PYTHONPATH for the test. Potentially to different values for Python 2.x and 3.x.
30 lines
826 B
Ruby
30 lines
826 B
Ruby
require 'formula'
|
|
|
|
class Pygtkglext < Formula
|
|
homepage 'http://projects.gnome.org/gtkglext/download.html#pygtkglext'
|
|
url 'http://downloads.sourceforge.net/gtkglext/pygtkglext-1.1.0.tar.gz'
|
|
sha1 '2ae3e87e8cdfc3318d8ff0e33b344377cb3df7cb'
|
|
|
|
depends_on 'pkg-config' => :build
|
|
depends_on :python
|
|
depends_on 'pygtk'
|
|
depends_on 'gtkglext'
|
|
depends_on 'pygobject'
|
|
|
|
def install
|
|
ENV['PYGTK_CODEGEN'] = Formula.factory('pygobject').opt_prefix/'bin/pygobject-codegen-2.0'
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
|
"--prefix=#{prefix}"
|
|
system "make install"
|
|
end
|
|
|
|
def caveats
|
|
python.standard_caveats if python
|
|
end
|
|
|
|
test do
|
|
python do
|
|
system python, "-c", "import pygtk", "pygtk.require('2.0')", "import gtk.gtkgl"
|
|
end
|
|
end
|
|
end
|