From 6ee8d9f6de57908448e32c397227ac02afa36116 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 3 Sep 2012 22:21:40 -0700 Subject: [PATCH] node: the build system needs Python 2.6 or newer Closes Homebrew/homebrew#14635. --- Formula/node.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Formula/node.rb b/Formula/node.rb index c2d33c503c1..d8689eeaa6e 100644 --- a/Formula/node.rb +++ b/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'