From d181890a89dc70a35eff25ae138567447bdfef8d Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Thu, 13 Sep 2012 17:24:45 -0700 Subject: [PATCH] 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. --- Formula/node.rb | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Formula/node.rb b/Formula/node.rb index a42f515fd72..8fe9938744c 100644 --- a/Formula/node.rb +++ b/Formula/node.rb @@ -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'