diff options
| author | Jack Nagel | 2012-08-09 02:00:58 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-08-12 17:28:15 -0500 |
| commit | 2eef46ae5a5aafd408aa0d4263377d448dfb74d4 (patch) | |
| tree | 2435fd5c4579ad89c0f466375282a90909f5370a /Library | |
| parent | bfeecd5ce5e7749139cfb708c0fa5a0c0a31a7bc (diff) | |
| download | homebrew-2eef46ae5a5aafd408aa0d4263377d448dfb74d4.tar.bz2 | |
Add :when_xquartz_installed as a keg-only reason
Using :when_xquartz_installed will tell the keg-only machinery to activate
if XQuartz is installed.
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/fontconfig.rb | 4 | ||||
| -rw-r--r-- | Library/Formula/freetype.rb | 2 | ||||
| -rw-r--r-- | Library/Formula/libpng.rb | 2 | ||||
| -rw-r--r-- | Library/Formula/pixman.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula_support.rb | 31 |
9 files changed, 35 insertions, 23 deletions
diff --git a/Library/Formula/cairo.rb b/Library/Formula/cairo.rb index 7fdff0726..258e32f88 100644 --- a/Library/Formula/cairo.rb +++ b/Library/Formula/cairo.rb @@ -5,9 +5,7 @@ class Cairo < Formula url 'http://cairographics.org/releases/cairo-1.12.2.tar.xz' sha256 'b786bc4a70542bcb09f2d9d13e5e6a0c86408cbf6d1edde5f0de807eecf93f96' - keg_only :provided_by_osx, - "The Cairo provided by Leopard is too old for newer software to link against." \ - if MacOS::X11.installed? + keg_only :when_xquartz_installed option :universal option 'without-x', 'Build without X11 support' diff --git a/Library/Formula/fontconfig.rb b/Library/Formula/fontconfig.rb index 410100b91..9ca876b54 100644 --- a/Library/Formula/fontconfig.rb +++ b/Library/Formula/fontconfig.rb @@ -5,9 +5,7 @@ class Fontconfig < Formula url 'http://fontconfig.org/release/fontconfig-2.10.1.tar.gz' sha1 'e377cbe989cd22d3a10020309c906ecbbcac0043' - keg_only :provided_by_osx, - "Leopard comes with version 2.4.x, which is too old for many packages." \ - if MacOS::X11.installed? + keg_only :when_xquartz_installed depends_on :freetype depends_on 'pkg-config' => :build diff --git a/Library/Formula/freetype.rb b/Library/Formula/freetype.rb index 513bb3b3b..578814d95 100644 --- a/Library/Formula/freetype.rb +++ b/Library/Formula/freetype.rb @@ -5,7 +5,7 @@ class Freetype < Formula url 'http://downloads.sf.net/project/freetype/freetype2/2.4.10/freetype-2.4.10.tar.gz' sha1 '44dba26ff965b1cd1c62e480fdefaeca62ed33da' - keg_only :provided_by_osx unless MacOS::X11.installed? + keg_only :when_xquartz_installed def install system "./configure", "--disable-debug", "--disable-dependency-tracking", diff --git a/Library/Formula/libpng.rb b/Library/Formula/libpng.rb index 098f15174..696563e06 100644 --- a/Library/Formula/libpng.rb +++ b/Library/Formula/libpng.rb @@ -5,7 +5,7 @@ class Libpng < Formula url 'http://downloads.sf.net/project/libpng/libpng15/1.5.12/libpng-1.5.12.tar.gz' sha1 'c329f3a9b720d7ae14e8205fa6e332236573704b' - keg_only :provided_by_osx if MacOS::X11.installed? + keg_only :when_xquartz_installed bottle do sha1 '83c6be83e86404f41982e5e1e6877924fe737bdf' => :mountainlion diff --git a/Library/Formula/pixman.rb b/Library/Formula/pixman.rb index 3d9503534..10b7c3a27 100644 --- a/Library/Formula/pixman.rb +++ b/Library/Formula/pixman.rb @@ -7,9 +7,7 @@ class Pixman < Formula depends_on 'pkg-config' => :build - keg_only :provided_by_osx, - "Apple provides an outdated version of libpixman in its X11 distribution." \ - if MacOS::X11.installed? + keg_only :when_xquartz_installed option :universal diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index ee5cc8e88..b9de91dbd 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -63,7 +63,7 @@ module Homebrew extend self if f.keg_only? puts puts "This formula is keg-only." - puts f.keg_only? + puts f.keg_only_reason puts end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 710a084c1..b61bb999a 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -174,7 +174,12 @@ class Formula # rarely, you don't want your library symlinked into the main prefix # see gettext.rb for an example def keg_only? - self.class.keg_only_reason || false + kor = self.class.keg_only_reason + not kor.nil? and kor.valid? + end + + def keg_only_reason + self.class.keg_only_reason end def fails_with? cc diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index bb9b7e230..949fbdcc4 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -425,7 +425,7 @@ end class Formula def keg_only_text # Add indent into reason so undent won't truncate the beginnings of lines - reason = self.keg_only?.to_s.gsub(/[\n]/, "\n ") + reason = self.keg_only_reason.to_s.gsub(/[\n]/, "\n ") return <<-EOS.undent This formula is keg-only, so it was not symlinked into #{HOMEBREW_PREFIX}. diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb index c0b920b2c..2119fbd11 100644 --- a/Library/Homebrew/formula_support.rb +++ b/Library/Homebrew/formula_support.rb @@ -136,19 +136,32 @@ class KegOnlyReason def initialize reason, explanation=nil @reason = reason @explanation = explanation + @valid = case @reason + when :when_xquartz_installed then MacOS::XQuartz.installed? + else true + end end - def to_s - if @reason == :provided_by_osx - <<-EOS.strip -Mac OS X already provides this program and installing another version in -parallel can cause all kinds of trouble. + def valid? + @valid + end -#{@explanation} -EOS + def to_s + case @reason + when :provided_by_osx then <<-EOS.undent + Mac OS X already provides this software and installing another version in + parallel can cause all kinds of trouble. + + #{@explanation} + EOS + when :when_xquartz_installed then <<-EOS.undent + XQuartz provides this software. + + #{@explanation} + EOS else - @reason.strip - end + @reason + end.strip end end |
