aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike McQuaid2014-01-04 13:13:56 +0000
committerMike McQuaid2014-01-04 13:35:46 +0000
commitdaf89e982c8cda64b3793fe251610303390f7880 (patch)
treebddf7b5e46f44a18311b1db2f7e2bae060cd1029 /Library/Formula
parent6674ab4064efb1410c2a523e26a96aa4145bc243 (diff)
downloadhomebrew-daf89e982c8cda64b3793fe251610303390f7880.tar.bz2
pygtk: cleanup python usage.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/pygtk.rb85
1 files changed, 38 insertions, 47 deletions
diff --git a/Library/Formula/pygtk.rb b/Library/Formula/pygtk.rb
index 2aa53b22e..7053c68f3 100644
--- a/Library/Formula/pygtk.rb
+++ b/Library/Formula/pygtk.rb
@@ -6,7 +6,6 @@ class Pygtk < Formula
sha1 '344e6a32a5e8c7e0aaeb807e0636a163095231c2'
depends_on 'pkg-config' => :build
- depends_on :python
depends_on :x11
depends_on 'glib'
depends_on 'gtk+'
@@ -19,13 +18,11 @@ class Pygtk < Formula
option 'glade', 'Python bindigs for glade. (to `import gtk.glade`)'
def install
- python do
- ENV.append 'CFLAGS', '-ObjC'
- ENV.universal_binary if build.universal?
- system "./configure", "--disable-dependency-tracking",
- "--prefix=#{prefix}"
- system "make install"
- end
+ ENV.append 'CFLAGS', '-ObjC'
+ ENV.universal_binary if build.universal?
+ system "./configure", "--disable-dependency-tracking",
+ "--prefix=#{prefix}"
+ system "make install"
# Fixing the pkgconfig file to find codegen, because it was moved from
# pygtk to pygobject. But our pkgfiles point into the cellar and in the
@@ -33,51 +30,45 @@ class Pygtk < Formula
inreplace lib/'pkgconfig/pygtk-2.0.pc', 'codegendir=${datadir}/pygobject/2.0/codegen', "codegendir=#{HOMEBREW_PREFIX}/share/pygobject/2.0/codegen"
end
- def caveats
- python.standard_caveats if python
- end
-
test do
- python do
- (testpath/'test.py').write <<-EOS.undent
- #!/usr/bin/env python
- import pygtk
- pygtk.require('2.0')
- import gtk
+ (testpath/'test.py').write <<-EOS.undent
+ #!/usr/bin/env python
+ import pygtk
+ pygtk.require('2.0')
+ import gtk
- class HelloWorld(object):
- def hello(self, widget, data=None):
- print "Hello World"
+ class HelloWorld(object):
+ def hello(self, widget, data=None):
+ print "Hello World"
- def delete_event(self, widget, event, data=None):
- print "delete event occurred"
- return False
+ def delete_event(self, widget, event, data=None):
+ print "delete event occurred"
+ return False
- def destroy(self, widget, data=None):
- print "destroy signal occurred"
- gtk.main_quit()
+ def destroy(self, widget, data=None):
+ print "destroy signal occurred"
+ gtk.main_quit()
- def __init__(self):
- self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
- self.window.connect("delete_event", self.delete_event)
- self.window.connect("destroy", self.destroy)
- self.window.set_border_width(10)
- self.button = gtk.Button("Hello World")
- self.button.connect("clicked", self.hello, None)
- self.button.connect_object("clicked", gtk.Widget.destroy, self.window)
- self.window.add(self.button)
- self.button.show()
- self.window.show()
+ def __init__(self):
+ self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
+ self.window.connect("delete_event", self.delete_event)
+ self.window.connect("destroy", self.destroy)
+ self.window.set_border_width(10)
+ self.button = gtk.Button("Hello World")
+ self.button.connect("clicked", self.hello, None)
+ self.button.connect_object("clicked", gtk.Widget.destroy, self.window)
+ self.window.add(self.button)
+ self.button.show()
+ self.window.show()
- def main(self):
- gtk.main()
+ def main(self):
+ gtk.main()
- if __name__ == "__main__":
- hello = HelloWorld()
- hello.main()
- EOS
- chmod 0755, 'test.py'
- system "./test.py"
- end
+ if __name__ == "__main__":
+ hello = HelloWorld()
+ hello.main()
+ EOS
+ chmod 0755, 'test.py'
+ system "./test.py"
end
end