diff options
| author | Jack Nagel | 2013-08-06 19:24:19 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-08-06 19:24:19 -0500 |
| commit | 9c300020f898b759ec68ccf64f150ba7b2afa666 (patch) | |
| tree | 0d46ef079027455655acf145b6a0c8441f2c0e05 /Library/Homebrew | |
| parent | 8a14b91d0180749c6cb1961e289b705b6cf863b8 (diff) | |
| download | brew-9c300020f898b759ec68ccf64f150ba7b2afa666.tar.bz2 | |
Eliminate MacSystem module
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/superenv.rb | 33 | ||||
| -rw-r--r-- | Library/Homebrew/superenv/macsystem.rb | 15 |
2 files changed, 19 insertions, 29 deletions
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb index af0d0825e..925d3381b 100644 --- a/Library/Homebrew/superenv.rb +++ b/Library/Homebrew/superenv.rb @@ -1,6 +1,5 @@ require 'extend/ENV' require 'macos' -require 'superenv/macsystem' ### Why `superenv`? # 1) Only specify the environment we need (NO LDFLAGS for cmake) @@ -12,12 +11,18 @@ require 'superenv/macsystem' # 7) Simpler formula that *just work* # 8) Build-system agnostic configuration of the tool-chain +module MacOS + def xcode43_without_clt? + MacOS::Xcode.version >= "4.3" and not MacOS::CLT.installed? + end +end + def superbin @bin ||= (HOMEBREW_REPOSITORY/"Library/ENV").children.reject{|d| d.basename.to_s > MacOS::Xcode.version }.max end def superenv? - return false if MacSystem.xcode43_without_clt? && MacOS.sdk_path.nil? + return false if MacOS.xcode43_without_clt? && MacOS.sdk_path.nil? return false unless superbin && superbin.directory? return false if ARGV.include? "--env=std" true @@ -54,7 +59,7 @@ class << ENV ENV['HOMEBREW_CC'] = determine_cc ENV['HOMEBREW_CCCFG'] = determine_cccfg ENV['HOMEBREW_BREW_FILE'] = HOMEBREW_BREW_FILE - ENV['HOMEBREW_SDKROOT'] = "#{MacOS.sdk_path}" if MacSystem.xcode43_without_clt? + ENV['HOMEBREW_SDKROOT'] = "#{MacOS.sdk_path}" if MacOS.xcode43_without_clt? ENV['HOMEBREW_DEVELOPER_DIR'] = determine_developer_dir # used by our xcrun shim ENV['CMAKE_PREFIX_PATH'] = determine_cmake_prefix_path ENV['CMAKE_FRAMEWORK_PATH'] = determine_cmake_frameworks_path @@ -146,12 +151,12 @@ class << ENV def determine_path paths = [superbin] - if MacSystem.xcode43_without_clt? + if MacOS.xcode43_without_clt? paths << "#{MacOS::Xcode.prefix}/usr/bin" paths << "#{MacOS::Xcode.prefix}/Toolchains/XcodeDefault.xctoolchain/usr/bin" end paths += deps.map{|dep| "#{HOMEBREW_PREFIX}/opt/#{dep}/bin" } - paths << "#{MacSystem.x11_prefix}/bin" if x11? + paths << "#{MacOS::X11.prefix}/bin" if x11? paths += %w{/usr/bin /bin /usr/sbin /sbin} paths.to_path_s end @@ -164,43 +169,43 @@ class << ENV def determine_pkg_config_libdir paths = %W{/usr/lib/pkgconfig #{HOMEBREW_REPOSITORY}/Library/ENV/pkgconfig/#{MacOS.version}} - paths << "#{MacSystem.x11_prefix}/lib/pkgconfig" << "#{MacSystem.x11_prefix}/share/pkgconfig" if x11? + paths << "#{MacOS::X11.prefix}/lib/pkgconfig" << "#{MacOS::X11.prefix}/share/pkgconfig" if x11? paths.to_path_s end def determine_cmake_prefix_path paths = keg_only_deps.map{|dep| "#{HOMEBREW_PREFIX}/opt/#{dep}" } paths << HOMEBREW_PREFIX.to_s # put ourselves ahead of everything else - paths << "#{MacOS.sdk_path}/usr" if MacSystem.xcode43_without_clt? + paths << "#{MacOS.sdk_path}/usr" if MacOS.xcode43_without_clt? paths.to_path_s end def determine_cmake_frameworks_path # XXX: keg_only_deps perhaps? but Qt does not link its Frameworks because of Ruby's Find.find ignoring symlinks!! paths = deps.map{|dep| "#{HOMEBREW_PREFIX}/opt/#{dep}/Frameworks" } - paths << "#{MacOS.sdk_path}/System/Library/Frameworks" if MacSystem.xcode43_without_clt? + paths << "#{MacOS.sdk_path}/System/Library/Frameworks" if MacOS.xcode43_without_clt? paths.to_path_s end def determine_cmake_include_path - sdk = MacOS.sdk_path if MacSystem.xcode43_without_clt? + sdk = MacOS.sdk_path if MacOS.xcode43_without_clt? paths = [] - paths << "#{MacSystem.x11_prefix}/include/freetype2" if x11? + paths << "#{MacOS::X11.prefix}/include/freetype2" if x11? paths << "#{sdk}/usr/include/libxml2" unless deps.include? 'libxml2' - if MacSystem.xcode43_without_clt? + if MacOS.xcode43_without_clt? paths << "#{sdk}/usr/include/apache2" end paths << "#{sdk}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/" unless x11? - paths << "#{MacSystem.x11_prefix}/include" if x11? + paths << "#{MacOS::X11.prefix}/include" if x11? paths.to_path_s end def determine_cmake_library_path - sdk = MacOS.sdk_path if MacSystem.xcode43_without_clt? + sdk = MacOS.sdk_path if MacOS.xcode43_without_clt? paths = [] # things expect to find GL headers since X11 used to be a default, so we add them paths << "#{sdk}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" unless x11? - paths << "#{MacSystem.x11_prefix}/lib" if x11? + paths << "#{MacOS::X11.prefix}/lib" if x11? paths.to_path_s end diff --git a/Library/Homebrew/superenv/macsystem.rb b/Library/Homebrew/superenv/macsystem.rb deleted file mode 100644 index 7dbb4794a..000000000 --- a/Library/Homebrew/superenv/macsystem.rb +++ /dev/null @@ -1,15 +0,0 @@ -module MacSystem - extend self - - def xcode_clt_installed? - MacOS::CLT.installed? - end - - def xcode43_without_clt? - MacOS::Xcode.version >= "4.3" and not MacSystem.xcode_clt_installed? - end - - def x11_prefix - MacOS::X11.prefix - end -end |
