diff options
| author | Jack Nagel | 2012-09-03 21:28:20 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-09-03 22:39:38 -0500 |
| commit | 2d1a9419764f1c59d0a9fa075e21eb4458129f90 (patch) | |
| tree | 8f0eb817302bb90e6a62326fc57805fbeec432cf /Library | |
| parent | 8094b00b55631f432c48f5d236bba6b510774c16 (diff) | |
| download | brew-2d1a9419764f1c59d0a9fa075e21eb4458129f90.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. Homebrew/homebrew#14474.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/extend/ENV.rb | 26 |
1 files changed, 19 insertions, 7 deletions
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, ':' |
