aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorJack Nagel2012-07-25 15:04:46 -0500
committerJack Nagel2012-08-01 00:31:38 -0500
commit148617bc1164c919eda86403ce2df197b913cdde (patch)
treecefbb21cf8a59dc6cee5996e9db9d7ec3c8121bd /Library/Homebrew/extend
parent1a48dbc967bdfb03c78240637233c9f9553678fc (diff)
downloadbrew-148617bc1164c919eda86403ce2df197b913cdde.tar.bz2
Move X11 machinery into MacOS::XQuartz namespace
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".
Diffstat (limited to 'Library/Homebrew/extend')
-rw-r--r--Library/Homebrew/extend/ENV.rb37
1 files changed, 14 insertions, 23 deletions
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 363c6d356..b6240d8e3 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -310,35 +310,26 @@ Please take one of the following actions:
end
def x11
- opoo "You do not have X11 installed, this formula may not build." unless MacOS.x11_installed?
-
- # There are some config scripts here that should go in the PATH. This
- # path is always under MacOS.x11_prefix, even for Xcode-only systems.
- prepend 'PATH', MacOS.x11_prefix/'bin', ':'
-
- # Similarily, pkgconfig files are only found under MacOS.x11_prefix.
- prepend 'PKG_CONFIG_PATH', MacOS.x11_prefix/'lib/pkgconfig', ':'
- prepend 'PKG_CONFIG_PATH', MacOS.x11_prefix/'share/pkgconfig', ':'
+ unless MacOS::XQuartz.installed?
+ opoo "You do not have X11 installed, this formula may not build."
+ end
- append 'LDFLAGS', "-L#{MacOS.x11_prefix}/lib"
- append 'CMAKE_PREFIX_PATH', MacOS.x11_prefix, ':'
+ # There are some config scripts here that should go in the PATH
+ prepend 'PATH', MacOS::XQuartz.bin, ':'
- # We prefer XQuartz if it is installed. Otherwise, we look for Apple's
- # X11. For Xcode-only systems, the headers are found in the SDK.
- prefix = if MacOS.x11_prefix.to_s == '/opt/X11' or MacOS::CLT.installed?
- MacOS.x11_prefix
- else
- MacOS.sdk_path/'usr/X11'
- end
+ prepend 'PKG_CONFIG_PATH', MacOS::XQuartz.lib/'pkgconfig', ':'
+ prepend 'PKG_CONFIG_PATH', MacOS::XQuartz.share/'pkgconfig', ':'
- append 'CPPFLAGS', "-I#{prefix}/include"
+ append 'LDFLAGS', "-L#{MacOS::XQuartz.lib}"
+ append 'CMAKE_PREFIX_PATH', MacOS::XQuartz.prefix, ':'
+ append 'CMAKE_INCLUDE_PATH', MacOS::XQuartz.include, ':'
- append 'CMAKE_PREFIX_PATH', prefix, ':'
- append 'CMAKE_INCLUDE_PATH', prefix/'include', ':'
+ append 'CPPFLAGS', "-I#{MacOS::XQuartz.include}"
unless MacOS::CLT.installed?
- append 'CPPFLAGS', "-I#{prefix}/include/freetype2"
- append 'CFLAGS', "-I#{prefix}/include"
+ append 'CMAKE_PREFIX_PATH', MacOS.sdk_path/'usr/X11', ':'
+ append 'CPPFLAGS', "-I#{MacOS::XQuartz.include}/freetype2"
+ append 'CFLAGS', "-I#{MacOS::XQuartz.include}"
end
end
alias_method :libpng, :x11