Adjust XQuartz/X11 module naming scheme

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-08-06 00:33:36 -05:00
parent 3ea35f3351
commit 7488b9844b
4 changed files with 24 additions and 14 deletions

View File

@ -60,7 +60,7 @@ module Homebrew extend self
def describe_x11
return "N/A" unless MacOS::XQuartz.installed?
return "#{MacOS::XQuartz.version} @ " + describe_path(MacOS::XQuartz.prefix)
return "XQuartz #{MacOS::XQuartz.version} in " + describe_path(MacOS::XQuartz.prefix)
end
def describe_perl

View File

@ -34,7 +34,7 @@ def llvm_build
end
def x11_installed?
MacOS::XQuartz.installed?
MacOS::X11.installed?
end
def macports_or_fink_installed?
@ -191,10 +191,10 @@ module MacOS extend self
end
def x11_installed?
XQuartz.installed?
X11.installed?
end
def x11_prefix
XQuartz.prefix
X11.prefix
end
end

View File

@ -314,26 +314,26 @@ Please take one of the following actions:
end
def x11
unless MacOS::XQuartz.installed?
unless MacOS::X11.installed?
opoo "You do not have X11 installed, this formula may not build."
end
# There are some config scripts here that should go in the PATH
prepend 'PATH', MacOS::XQuartz.bin, ':'
prepend 'PATH', MacOS::X11.bin, ':'
prepend 'PKG_CONFIG_PATH', MacOS::XQuartz.lib/'pkgconfig', ':'
prepend 'PKG_CONFIG_PATH', MacOS::XQuartz.share/'pkgconfig', ':'
prepend 'PKG_CONFIG_PATH', MacOS::X11.lib/'pkgconfig', ':'
prepend 'PKG_CONFIG_PATH', MacOS::X11.share/'pkgconfig', ':'
append 'LDFLAGS', "-L#{MacOS::XQuartz.lib}"
append 'CMAKE_PREFIX_PATH', MacOS::XQuartz.prefix, ':'
append 'CMAKE_INCLUDE_PATH', MacOS::XQuartz.include, ':'
append 'LDFLAGS', "-L#{MacOS::X11.lib}"
append 'CMAKE_PREFIX_PATH', MacOS::X11.prefix, ':'
append 'CMAKE_INCLUDE_PATH', MacOS::X11.include, ':'
append 'CPPFLAGS', "-I#{MacOS::XQuartz.include}"
append 'CPPFLAGS', "-I#{MacOS::X11.include}"
unless MacOS::CLT.installed?
append 'CMAKE_PREFIX_PATH', MacOS.sdk_path/'usr/X11', ':'
append 'CPPFLAGS', "-I#{MacOS::XQuartz.include}/freetype2"
append 'CFLAGS', "-I#{MacOS::XQuartz.include}"
append 'CPPFLAGS', "-I#{MacOS::X11.include}/freetype2"
append 'CFLAGS', "-I#{MacOS::X11.include}"
end
end
alias_method :libpng, :x11

View File

@ -26,6 +26,16 @@ module MacOS::XQuartz extend self
def installed?
not prefix.nil?
end
end
module MacOS::X11 extend self
def prefix
MacOS::XQuartz.prefix
end
def installed?
MacOS::XQuartz.installed?
end
# If XQuartz and/or the CLT are installed, headers will be found under
# /opt/X11/include or /usr/X11/include. For Xcode-only systems, they are