aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-08-29 11:19:39 -0400
committerMax Howell2012-08-29 12:41:37 -0400
commita360a41472cad35dfdf81d1551df55b442a22ba1 (patch)
tree2c3d0b9d71ad2976479cd87d0a73f35a869c08cc /Library
parentb834027b179c72c47339b7dd65c7cbf2b8ed4b0a (diff)
downloadbrew-a360a41472cad35dfdf81d1551df55b442a22ba1.tar.bz2
superenv only adds X11 paths if required
Since we are moving towards only depending on X11 for X-headers, superenv now doesn't automatically add X11 compilation. I was reluctant to do this, but it is the right thing to do now that X11 is not automatically installed by OS X or Xcode. I didn't implement ENV.x11 because the order that the X headers are inserted is important. It must be done at initial setup to ensure that brewed versions of e.g. freetype and Cairo are used and not the ones installed by XQuartz.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/build.rb1
-rw-r--r--Library/Homebrew/superenv.rb13
2 files changed, 9 insertions, 5 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index 77960f8ee..99e8a3550 100755
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -83,6 +83,7 @@ def install f
if superenv?
ENV.deps = keg_only_deps.map(&:to_s)
+ ENV.x11 = f.requirements.detect{|rq| rq.class == X11Dependency }
ENV.setup_build_environment
class << ENV
def []=(key, value)
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb
index 50ae6aa93..5bf815dcb 100644
--- a/Library/Homebrew/superenv.rb
+++ b/Library/Homebrew/superenv.rb
@@ -24,6 +24,8 @@ end
class << ENV
attr :deps, true
+ attr :x11, true
+ alias_method :x11?, :x11
def reset
%w{CC CXX LD CPP OBJC MAKE
@@ -100,7 +102,7 @@ class << ENV
end
paths += deps.map{|dep| "#{HOMEBREW_PREFIX}/opt/#{dep}/bin" }
paths << HOMEBREW_PREFIX/:bin
- paths << "#{MacSystem.x11_prefix}/bin"
+ paths << "#{MacSystem.x11_prefix}/bin" if x11?
paths += %w{/usr/bin /bin /usr/sbin /sbin}
paths.to_path_s
end
@@ -111,7 +113,7 @@ class << ENV
paths << "#{HOMEBREW_REPOSITORY}/lib/pkgconfig"
paths << "#{HOMEBREW_REPOSITORY}/share/pkgconfig"
# we put our paths before X because we dupe some of the X libraries
- paths << "#{MacSystem.x11_prefix}/lib/pkgconfig" << "#{MacSystem.x11_prefix}/share/pkgconfig"
+ paths << "#{MacSystem.x11_prefix}/lib/pkgconfig" << "#{MacSystem.x11_prefix}/share/pkgconfig" if x11?
# Mountain Lion no longer ships some .pcs; ensure we pick up our versions
paths << "#{HOMEBREW_REPOSITORY}/Library/Homebrew/pkgconfig" if MacOS.mountain_lion?
paths.to_path_s
@@ -121,13 +123,14 @@ class << ENV
paths = deps.map{|dep| "#{HOMEBREW_PREFIX}/opt/#{dep}" }
paths << "#{MacOS.sdk_path}/usr" if MacSystem.xcode43_without_clt?
paths << HOMEBREW_PREFIX.to_s # again always put ourselves ahead of X11
- paths << MacSystem.x11_prefix
+ paths << MacSystem.x11_prefix if x11?
paths.to_path_s
end
def determine_cmake_include_path
sdk = MacOS.sdk_path if MacSystem.xcode43_without_clt?
- paths = %W{#{MacSystem.x11_prefix}/include/freetype2}
+ paths = []
+ paths << "#{MacSystem.x11_prefix}/include/freetype2" if x11?
paths << "#{sdk}/usr/include/libxml2" unless deps.include? 'libxml2'
# TODO prolly shouldn't always do this?
paths << "#{sdk}/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7" if MacSystem.xcode43_without_clt?
@@ -137,7 +140,7 @@ class << ENV
def determine_aclocal_path
paths = deps.map{|dep| "#{HOMEBREW_PREFIX}/opt/#{dep}/share/aclocal" }
paths << "#{HOMEBREW_PREFIX}/share/aclocal"
- paths << "/opt/X11/share/aclocal"
+ paths << "/opt/X11/share/aclocal" if x11?
paths.to_path_s
end