diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/macos.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb index 632077dbf..c0d31e6fe 100644 --- a/Library/Homebrew/macos.rb +++ b/Library/Homebrew/macos.rb @@ -5,6 +5,8 @@ module MacOS extend self XCODE_3_BUNDLE_ID = "com.apple.Xcode" CLT_STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" CLT_FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" + APPLE_X11_BUNDLE_ID = "org.x.X11" + XQUARTZ_BUNDLE_ID = "org.macosforge.xquartz.X11" def version MACOS_VERSION @@ -313,6 +315,16 @@ module MacOS extend self end end + def xquartz_version + # This returns the version number of XQuartz, not of the upstream X.org + # (which is why it is not called x11_version). Note that the X11.app + # distributed by Apple is also XQuartz, and therefore covered by this method. + path = app_with_bundle_id(XQUARTZ_BUNDLE_ID) or app_with_bundle_id(APPLE_X11_BUNDLE_ID) + version = if not path.nil? and path.exist? + `mdls -raw -name kMDItemVersion #{path}`.strip + end + end + def x11_prefix @x11_prefix ||= if Pathname.new('/opt/X11/lib/libpng.dylib').exist? Pathname.new('/opt/X11') |
