Move superbin into Superenv module

This commit is contained in:
Jack Nagel 2013-08-19 12:32:56 -05:00
parent ab5c6218b1
commit a04f1ac3d3

View File

@ -11,13 +11,9 @@ require 'macos'
# 7) Simpler formula that *just work* # 7) Simpler formula that *just work*
# 8) Build-system agnostic configuration of the tool-chain # 8) Build-system agnostic configuration of the tool-chain
def superbin
@bin ||= (HOMEBREW_REPOSITORY/"Library/ENV").children.reject{|d| d.basename.to_s > MacOS::Xcode.version }.max
end
def superenv? def superenv?
return false if MacOS::Xcode.without_clt? && MacOS.sdk_path.nil? return false if MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?
return false unless superbin && superbin.directory? return false unless Superenv.bin && Superenv.bin.directory?
return false if ARGV.include? "--env=std" return false if ARGV.include? "--env=std"
true true
end end
@ -31,6 +27,10 @@ module Superenv
base.deps = [] base.deps = []
end end
def self.bin
@bin ||= (HOMEBREW_REPOSITORY/"Library/ENV").children.reject{|d| d.basename.to_s > MacOS::Xcode.version }.max
end
def reset def reset
%w{CC CXX OBJC OBJCXX CPP MAKE LD LDSHARED %w{CC CXX OBJC OBJCXX CPP MAKE LD LDSHARED
CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS CFLAGS CXXFLAGS OBJCFLAGS OBJCXXFLAGS LDFLAGS CPPFLAGS
@ -149,7 +149,7 @@ module Superenv
end end
def determine_path def determine_path
paths = [superbin] paths = [Superenv.bin]
if MacOS::Xcode.without_clt? if MacOS::Xcode.without_clt?
paths << "#{MacOS::Xcode.prefix}/usr/bin" paths << "#{MacOS::Xcode.prefix}/usr/bin"
paths << "#{MacOS::Xcode.prefix}/Toolchains/XcodeDefault.xctoolchain/usr/bin" paths << "#{MacOS::Xcode.prefix}/Toolchains/XcodeDefault.xctoolchain/usr/bin"