aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorSamuel John2012-12-05 09:59:17 +0100
committerAdam Vandenberg2013-01-04 12:17:41 -0800
commit3855fd59005ecce7164763d1b6c733f5f7a09404 (patch)
tree1963c4bf78069e52749af95f035002e2089344a4 /Library/Formula
parentfe15d281a898e75bc99ffb4bd23bc2d8ff037f0f (diff)
downloadhomebrew-3855fd59005ecce7164763d1b6c733f5f7a09404.tar.bz2
pygtksourceview: New formula (2.10.0)
- New formula pygtksourceview with test (fixes #16410) - Fix the pkgconfig file of pygtk, too, because the GTK project moved the `codegen` executable from pygtk into pygobject. - Fix minor typo in pygtk. Fixes #16410. Closes #16418. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/pygtk.rb7
-rw-r--r--Library/Formula/pygtksourceview.rb32
2 files changed, 38 insertions, 1 deletions
diff --git a/Library/Formula/pygtk.rb b/Library/Formula/pygtk.rb
index 00e5e22d7..30fd31990 100644
--- a/Library/Formula/pygtk.rb
+++ b/Library/Formula/pygtk.rb
@@ -13,7 +13,7 @@ class Pygtk < Formula
depends_on 'libglade' if build.include? 'glade'
option :universal
- option 'glade', 'Python bindigs for glade. (to `import gtk.glade1)'
+ option 'glade', 'Python bindigs for glade. (to `import gtk.glade`)'
def install
ENV.append 'CFLAGS', '-ObjC'
@@ -21,6 +21,11 @@ class Pygtk < Formula
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
+ # pygtk-cellar there is no pygobject.
+ inreplace lib/'pkgconfig/pygtk-2.0.pc', 'codegendir=${datadir}/pygobject/2.0/codegen', "codegendir=#{HOMEBREW_PREFIX}/share/pygobject/2.0/codegen"
end
def caveats; <<-EOS.undent
diff --git a/Library/Formula/pygtksourceview.rb b/Library/Formula/pygtksourceview.rb
new file mode 100644
index 000000000..84906d1a3
--- /dev/null
+++ b/Library/Formula/pygtksourceview.rb
@@ -0,0 +1,32 @@
+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 '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; <<-EOS.undent
+ For non-homebrew Python, you need to amend your PYTHONPATH like so:
+ export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH
+ EOS
+ end
+
+ def which_python
+ "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
+ end
+
+ def test
+ system "python -c 'import gtksourceview2'"
+ end
+end