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.
29 lines
824 B
Ruby
29 lines
824 B
Ruby
require 'formula'
|
|
|
|
class Pygtksourceview < Formula
|
|
homepage 'http://projects.gnome.org/gtksourceview/pygtksourceview.html'
|
|
url 'http://ftp.gnome.org/pub/gnome/sources/pygtksourceview/2.10/pygtksourceview-2.10.0.tar.bz2'
|
|
sha256 'bfdde2ce4f61d461fb34dece9433cf81a73a9c9de6b62d4eb06177b8c9cec9c7'
|
|
|
|
depends_on 'pkg-config' => :build
|
|
depends_on :python
|
|
depends_on 'gtksourceview'
|
|
depends_on 'pygtk'
|
|
|
|
def install
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--prefix=#{prefix}",
|
|
"--disable-docs" # attempts to download chunk.xsl on demand (and sometimes fails)
|
|
system "make install"
|
|
end
|
|
|
|
def caveats
|
|
python.standard_caveats if python
|
|
end
|
|
|
|
test do
|
|
python do
|
|
system python, "-c", "import gtksourceview2"
|
|
end
|
|
end
|
|
end
|