MacOS: update locate_cctool
This becomes MacOS.{install_name_tool,otool}, only do check_xcode if
xcode is installed, otherwise emit a warning
This commit is contained in:
parent
8aad523063
commit
85187bf6d3
@ -157,7 +157,12 @@ module Homebrew
|
|||||||
def perform_preinstall_checks
|
def perform_preinstall_checks
|
||||||
check_ppc
|
check_ppc
|
||||||
check_writable_install_location
|
check_writable_install_location
|
||||||
check_xcode
|
if MacOS::Xcode.installed?
|
||||||
|
check_xcode
|
||||||
|
else
|
||||||
|
opoo "You have not installed Xcode."
|
||||||
|
puts "Bottles may install correctly, but builds will fail!"
|
||||||
|
end
|
||||||
check_cellar
|
check_cellar
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -98,8 +98,8 @@ class Keg
|
|||||||
end
|
end
|
||||||
|
|
||||||
def install_name_tool(*args)
|
def install_name_tool(*args)
|
||||||
tool = MacOS.locate("install_name_tool")
|
tool = MacOS.install_name_tool
|
||||||
system(tool, *args) || raise(ErrorDuringExecution.new(tool, args))
|
system(tool, *args) || raise ErrorDuringExecution.new(tool, args)
|
||||||
end
|
end
|
||||||
|
|
||||||
# If file is a dylib or bundle itself, look for the dylib named by
|
# If file is a dylib or bundle itself, look for the dylib named by
|
||||||
|
|||||||
@ -154,9 +154,9 @@ module MachO
|
|||||||
|
|
||||||
def parse_otool_L_output
|
def parse_otool_L_output
|
||||||
ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s
|
ENV["HOMEBREW_MACH_O_FILE"] = path.expand_path.to_s
|
||||||
libs = `#{MacOS.locate("otool")} -L "$HOMEBREW_MACH_O_FILE"`.split("\n")
|
libs = `#{MacOS.otool} -L "$HOMEBREW_MACH_O_FILE"`.split("\n")
|
||||||
unless $?.success?
|
unless $?.success?
|
||||||
raise ErrorDuringExecution.new(MacOS.locate("otool"),
|
raise ErrorDuringExecution.new(MacOS.otool,
|
||||||
["-L", ENV["HOMEBREW_MACH_O_FILE"]])
|
["-L", ENV["HOMEBREW_MACH_O_FILE"]])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,22 @@ module OS
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def install_name_tool
|
||||||
|
if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/install_name_tool")
|
||||||
|
Pathname.new(path)
|
||||||
|
else
|
||||||
|
locate("install_name_tool")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def otool
|
||||||
|
if File.executable?(path = "#{HOMEBREW_PREFIX}/opt/cctools/bin/otool")
|
||||||
|
Pathname.new(path)
|
||||||
|
else
|
||||||
|
locate("otool")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def active_developer_dir
|
def active_developer_dir
|
||||||
@active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip
|
@active_developer_dir ||= Utils.popen_read("/usr/bin/xcode-select", "-print-path").strip
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user