aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/node.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2012-09-03 22:21:40 -0700
committerAdam Vandenberg2012-09-03 22:21:55 -0700
commit1527a106cb31a20c34d709f084686e6d1945d56b (patch)
tree4498ecbacc4c676f56c100fdc326f60efc9a36e5 /Library/Formula/node.rb
parent7053db47f7f62e8d88238ffc8b56b5059364add6 (diff)
downloadhomebrew-1527a106cb31a20c34d709f084686e6d1945d56b.tar.bz2
node: the build system needs Python 2.6 or newer
Closes #14635.
Diffstat (limited to 'Library/Formula/node.rb')
-rw-r--r--Library/Formula/node.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Formula/node.rb b/Library/Formula/node.rb
index c2d33c503..d8689eeaa 100644
--- a/Library/Formula/node.rb
+++ b/Library/Formula/node.rb
@@ -1,5 +1,15 @@
require 'formula'
+class PythonVersion < Requirement
+ def message; <<-EOS.undent
+ Node's build system, gyp, requires Python 2.6 or newer.
+ EOS
+ end
+ def satisfied?
+ `python -c 'import sys;print(sys.version[:3])'`.strip.to_f >= 2.6
+ end
+end
+
class NpmNotInstalled < Requirement
def modules_folder
"#{HOMEBREW_PREFIX}/lib/node_modules"
@@ -42,6 +52,7 @@ class Node < Formula
# Leopard OpenSSL is not new enough, so use our keg-only one
depends_on 'openssl' if MacOS.leopard?
depends_on NpmNotInstalled.new unless build.include? 'without-npm'
+ depends_on PythonVersion.new
option 'enable-debug', 'Build with debugger hooks'
option 'without-npm', 'npm will not be installed'