aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-03-08 12:08:10 +0000
committerMike McQuaid2014-03-12 13:57:03 +0000
commitab1ba4ed836bf7cd60a2ad45b556ffb84fdd0974 (patch)
tree6d50b7e53f82890a83f99791beb66b3790f79950 /Library
parenteae88425082acbf571d256aa768b3522f0664bd5 (diff)
downloadhomebrew-ab1ba4ed836bf7cd60a2ad45b556ffb84fdd0974.tar.bz2
pygobject3: use Language::Python.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/pygobject3.rb46
1 files changed, 3 insertions, 43 deletions
diff --git a/Library/Formula/pygobject3.rb b/Library/Formula/pygobject3.rb
index 9af8d1101..6d85733b9 100644
--- a/Library/Formula/pygobject3.rb
+++ b/Library/Formula/pygobject3.rb
@@ -1,29 +1,5 @@
require 'formula'
-class PythonEnvironment < Requirement
- fatal true
-
- def error_message
- if !Formula["python"].installed? && ARGV.include?("--with-python3")
- error_message = <<-EOS.undent
- You cannot use system Python 2 and Homebrew's Python 3
- simultaneously.
- Either `brew install python` or use `--without-python3`.
- EOS
- elsif ARGV.include?("--without-python") && !ARGV.include?("--with-python3")
- error_message = " --with-python3 must be specified when using --without-python"
- end
- end
-
- satisfy do
- error_message == nil
- end
-
- def message
- error_message
- end
-end
-
class Pygobject3 < Formula
homepage 'http://live.gnome.org/PyGObject'
url 'http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.10/pygobject-3.10.2.tar.xz'
@@ -53,18 +29,6 @@ class Pygobject3 < Formula
option :universal
- depends_on PythonEnvironment
-
- def pythons
- pythons = []
- ["python", "python3"].each do |python|
- next if build.without? python
- version = /\d\.\d/.match `#{python} --version 2>&1`
- pythons << [python, version]
- end
- pythons
- end
-
def patches
"https://gist.github.com/krrk/6439665/raw/a527e14cd3a77c19b089f27bea884ce46c988f55/pygobject-fix-module.patch" if build.with? 'tests'
end
@@ -79,12 +43,12 @@ class Pygobject3 < Formula
system "./autogen.sh"
end
- pythons.each do |python, version|
+ Language::Python.each_python(build) do |python, version|
ENV["PYTHON"] = "#{python}" if Formula[python].installed?
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
system "make", "install"
system "make", "check" if build.with? 'tests'
- system "make", "clean" if pythons.length > 1
+ system "make", "clean"
end
end
@@ -93,11 +57,7 @@ class Pygobject3 < Formula
import gi
assert("__init__" in gi.__file__)
EOS
- pythons.each do |python, version|
- unless Formula[python].installed?
- ENV["PYTHONPATH"] = HOMEBREW_PREFIX/"lib/python#{version}/site-packages"
- ENV.append_path "PYTHONPATH", "#{opt_lib}/python#{version}/site-packages"
- end
+ Language::Python.each_python(build) do |python, version|
system python, "test.py"
end
end