node: Better workaround for CLT-only systems

Instead of requiring a full XCode install, we can use the `DEVELOPER_PATH`
environment variable to lie to `xcode-select` in a way that should restrict any
consequences to the Node build.
master
Charlie Sharpsteen 2012-09-13 17:24:45 -07:00
parent eb23f257a5
commit d181890a89
1 changed files with 7 additions and 10 deletions

View File

@ -54,16 +54,6 @@ class Node < Formula
depends_on NpmNotInstalled.new unless build.include? 'without-npm'
depends_on PythonVersion.new
# There is a bug with the GYP buildsystem that prevents Node from compiling
# on CLT-only systems with unset `xcode-select` paths:
#
# http://code.google.com/p/gyp/issues/detail?id=292
#
# See the following issue for more info:
#
# joyent/node#3681
depends_on :xcode
option 'enable-debug', 'Build with debugger hooks'
option 'without-npm', 'npm will not be installed'
@ -72,6 +62,13 @@ class Node < Formula
end
def install
# Lie to `xcode-select` for now to work around a GYP bug that affects
# CLT-only systems:
#
# http://code.google.com/p/gyp/issues/detail?id=292
# joyent/node#3681
ENV['DEVELOPER_DIR'] = MacOS.dev_tools_path unless MacOS.xcode_installed?
args = %W{--prefix=#{prefix}}
args << "--debug" if build.include? 'enable-debug'
args << "--without-npm" if build.include? 'without-npm'