diff options
| author | Jack Nagel | 2012-09-03 21:28:20 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-09-03 22:39:38 -0500 |
| commit | 93a4c48e369920d18bfd8835c8b27e98bccf01f5 (patch) | |
| tree | 1ff2dba89145fa2ad724e535b9460690db8df5f1 /Library | |
| parent | fb93fb2b2eab75220901e0211300924d75aa27e7 (diff) | |
| download | homebrew-93a4c48e369920d18bfd8835c8b27e98bccf01f5.tar.bz2 | |
Sort out remaining XQuartz/stdenv issues
We use PKG_CONFIG_LIBDIR to reset the default search path, overriding
whatever is baked into the pkg-config executable. This way, we can later
append XQuartz paths here while still allowing any brewed libs to take
precedence, keg-only or not.
Hopefully this will resolve any remaining issues, and let us get rid of
some per-formula hacks.
c.f. #14474.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/cairo.rb | 4 | ||||
| -rw-r--r-- | Library/Formula/gtk+.rb | 5 | ||||
| -rw-r--r-- | Library/Formula/gtk+3.rb | 5 | ||||
| -rw-r--r-- | Library/Formula/pango.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV.rb | 26 |
5 files changed, 19 insertions, 26 deletions
diff --git a/Library/Formula/cairo.rb b/Library/Formula/cairo.rb index e171712fa..da8acab3f 100644 --- a/Library/Formula/cairo.rb +++ b/Library/Formula/cairo.rb @@ -23,10 +23,6 @@ class Cairo < Formula def install ENV.universal_binary if build.universal? - pixman = Formula.factory('pixman') - ENV['pixman_CFLAGS'] = "-I#{pixman.include}/pixman-1" - ENV['pixman_LIBS'] = "-L#{pixman.lib} -lpixman-1" - args = %W[ --disable-dependency-tracking --prefix=#{prefix} diff --git a/Library/Formula/gtk+.rb b/Library/Formula/gtk+.rb index 7ccfae524..2b6b65781 100644 --- a/Library/Formula/gtk+.rb +++ b/Library/Formula/gtk+.rb @@ -23,11 +23,6 @@ class Gtkx < Formula end def install - # Always prefer our cairo over XQuartz cairo - cairo = Formula.factory('cairo') - ENV['CAIRO_BACKEND_CFLAGS'] = "-I#{cairo.include}/cairo" - ENV['CAIRO_BACKEND_LIBS'] = "-L#{cairo.lib} -lcairo" - system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", diff --git a/Library/Formula/gtk+3.rb b/Library/Formula/gtk+3.rb index a506222c3..7cab0ad05 100644 --- a/Library/Formula/gtk+3.rb +++ b/Library/Formula/gtk+3.rb @@ -18,11 +18,6 @@ class Gtkx3 < Formula depends_on 'atk' => :optional def install - # Always prefer our cairo over XQuartz cairo - cairo = Formula.factory('cairo') - ENV['CAIRO_BACKEND_CFLAGS'] = "-I#{cairo.include}/cairo" - ENV['CAIRO_BACKEND_LIBS'] = "-L#{cairo.lib} -lcairo" - system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", diff --git a/Library/Formula/pango.rb b/Library/Formula/pango.rb index 48b8a09ee..4edef0327 100644 --- a/Library/Formula/pango.rb +++ b/Library/Formula/pango.rb @@ -25,11 +25,6 @@ class Pango < Formula end def install - # Always prefer our cairo over XQuartz cairo - cairo = Formula.factory('cairo') - ENV['CAIRO_CFLAGS'] = "-I#{cairo.include}/cairo" - ENV['CAIRO_LIBS'] = "-L#{cairo.lib} -lcairo" - args = %W[ --disable-dependency-tracking --prefix=#{prefix} diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb index b1d7eab12..e8c0c0ad3 100644 --- a/Library/Homebrew/extend/ENV.rb +++ b/Library/Homebrew/extend/ENV.rb @@ -14,12 +14,12 @@ module HomebrewEnvExtension # it encounters files with mixed character sets delete('LC_ALL') self['LC_CTYPE']="C" - - # Mountain Lion no longer ships a few .pcs; make sure we pick up our versions - prepend 'PKG_CONFIG_PATH', - HOMEBREW_REPOSITORY/'Library/Homebrew/pkgconfig', ':' end + # Set the default pkg-config search path, overriding the built-in paths + # Anything in PKG_CONFIG_PATH is searched before paths in this variable + self['PKG_CONFIG_LIBDIR'] = determine_pkg_config_libdir + # make any aclocal stuff installed in Homebrew available self['ACLOCAL_PATH'] = "#{HOMEBREW_PREFIX}/share/aclocal" if MacOS::Xcode.provides_autotools? @@ -66,6 +66,15 @@ module HomebrewEnvExtension end end + def determine_pkg_config_libdir + paths = [] + paths << HOMEBREW_PREFIX/'lib/pkgconfig' + paths << HOMEBREW_PREFIX/'share/pkgconfig' + paths << HOMEBREW_REPOSITORY/'Library/Homebrew/pkgconfig' if MacOS.version >= :mountain_lion + paths << '/usr/lib/pkgconfig' + paths.select { |d| File.directory? d }.join(':') + end + def deparallelize remove 'MAKEFLAGS', /-j\d+/ end @@ -249,10 +258,13 @@ module HomebrewEnvExtension def x11 # There are some config scripts here that should go in the PATH - prepend 'PATH', MacOS::X11.bin, ':' + append 'PATH', MacOS::X11.bin, ':' - prepend 'PKG_CONFIG_PATH', MacOS::X11.lib/'pkgconfig', ':' - prepend 'PKG_CONFIG_PATH', MacOS::X11.share/'pkgconfig', ':' + # Append these to PKG_CONFIG_LIBDIR so they are searched + # *after* our own pkgconfig directories, as we dupe some of the + # libs in XQuartz. + append 'PKG_CONFIG_LIBDIR', MacOS::X11.lib/'pkgconfig', ':' + append 'PKG_CONFIG_LIBDIR', MacOS::X11.share/'pkgconfig', ':' append 'LDFLAGS', "-L#{MacOS::X11.lib}" append 'CMAKE_PREFIX_PATH', MacOS::X11.prefix, ':' |
