This will allow us to do comparisons like
if MacOS.version >= :lion
and hopefully deprecate the MacOS.<name>? family of methods, which are
counterinitutive.
A user on IRC was getting strange results from MacOS.dev_tools_path.
It turns out that xcrun's exit status is not always reliable - if
xcrun is a shim and not able to locate the real xcrun, it will exit
0 despite not actually doing what it was asked. Instead check to see
if the stout is empty.
In order to better support Xcode-only systems, where X11 libs and
executables live under /usr/X11 but headers live in the SDK, move the
x11_* helper methods into a new module.
This allows us to keep some of the CLT/Xcode-only and Apple X11/XQuartz
logic hidden from outside code, like ENV.x11.
Since Apple's X11 is actually XQuartz, name the module "MacOS::XQuartz".
MacOS.sdk_path is meant to return the SDK path that matches the version
argument, so store the result in a hash.
FixesHomebrew/homebrew#13623.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Checking "not clt_version.empty?" is unnecessary if we are also checking
that dev_tools_path is /usr/bin.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>