diff options
| author | Stein Magnus Jodal | 2012-09-12 13:38:12 +0200 |
|---|---|---|
| committer | Adam Vandenberg | 2012-09-15 13:14:40 -0700 |
| commit | 67f1f5aad0cfe55244ee29e4bc860504a8dc96b9 (patch) | |
| tree | 773b23d726d3dd9207acc332b71e558132d2fc7d /Library/Formula | |
| parent | deda2732b5607e9f88d5ef23a59b3c9e5caceac3 (diff) | |
| download | homebrew-67f1f5aad0cfe55244ee29e4bc860504a8dc96b9.tar.bz2 | |
gst-python 0.10.22
Closes #14879.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/gst-python.rb | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Library/Formula/gst-python.rb b/Library/Formula/gst-python.rb new file mode 100644 index 000000000..32220075d --- /dev/null +++ b/Library/Formula/gst-python.rb @@ -0,0 +1,55 @@ +require 'formula' + +class GstPython < Formula + homepage 'http://gstreamer.freedesktop.org/' + url 'http://gstreamer.freedesktop.org/src/gst-python/gst-python-0.10.22.tar.bz2' + sha1 '7012445d921ae1b325c162500750c9b0e777201f' + + depends_on 'pkg-config' => :build + depends_on 'gst-plugins-base' + depends_on 'pygtk' + + def install + system "./configure", "--disable-dependency-tracking", + "--prefix=#{prefix}" + 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 + mktemp do + (Pathname.pwd+'test.py').write <<-EOS.undent + #!/usr/bin/env python + + import time + + import pygst + pygst.require('0.10') + import gst + + import gobject + gobject.threads_init() + + def main(): + pipeline = gst.parse_launch( + 'audiotestsrc ! audioresample ! fakesink') + pipeline.set_state(gst.STATE_PLAYING) + time.sleep(3) + + if __name__ == "__main__": + main() + EOS + system "chmod +x test.py" + system "./test.py" + end + end +end |
