diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/gettext.rb | 10 | ||||
| -rw-r--r-- | Library/Formula/glib.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/brewkit.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 5 | ||||
| -rwxr-xr-x | Library/Homebrew/install.rb | 34 |
5 files changed, 46 insertions, 14 deletions
diff --git a/Library/Formula/gettext.rb b/Library/Formula/gettext.rb index 9f5a9bfe1..c52e99d74 100644 --- a/Library/Formula/gettext.rb +++ b/Library/Formula/gettext.rb @@ -4,11 +4,15 @@ class Gettext <Formula @url='http://ftp.gnu.org/pub/gnu/gettext/gettext-0.17.tar.gz' @md5='58a2bc6d39c0ba57823034d55d65d606' @homepage='http://www.gnu.org/software/gettext/' - + def patches 'http://gist.github.com/raw/186336/2fe65fab894f94a03aab2f03349ae7f1febcd301/mac-osx-105-environ.patch' end + def keg_only? + "OS X provides the BSD gettext library and some software gets confused if both are in the library path." + end + def install ENV.libxml2 # TODO seems like this package needs more optmisation @@ -28,9 +32,5 @@ class Gettext <Formula system "make install" (doc+'examples').rmtree unless ARGV.include? '--with-examples' - - def caveats - "GNU gettext is bloated and manky, please try not to depend on it" - end end end diff --git a/Library/Formula/glib.rb b/Library/Formula/glib.rb index dd7f26dfb..bc5b841f2 100644 --- a/Library/Formula/glib.rb +++ b/Library/Formula/glib.rb @@ -18,7 +18,8 @@ class Glib <Formula end def install - + ENV.gnu_gettext + # Snow Leopard libiconv doesn't have a 64bit version of the libiconv_open # function, which breaks things for us, so we build our own # http://www.mail-archive.com/gtk-list@gnome.org/msg28747.html diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb index 41422ed9e..ebf2235ed 100644 --- a/Library/Homebrew/brewkit.rb +++ b/Library/Homebrew/brewkit.rb @@ -143,6 +143,14 @@ module HomebrewEnvExtension def enable_warnings remove_from_cflags '-w' end + # so yeah, GNU gettext is a funny one, if you want to use it, you need to + # call this function, see gettext.rb for info. + def gnu_gettext + gettext = Formula.factory 'gettext' + ENV['LDFLAGS'] += " -L#{gettext.lib}" + ENV['CPPFLAGS'] = "#{ENV['CPPFLAGS']} -I#{gettext.include}" + ENV['PATH'] += ":#{gettext.bin}" + end private def append key, value diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index cd095f05e..ee9bd36f6 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -114,13 +114,16 @@ class Formula # :p1 => 'http://bar.com/patch2', # :p2 => ['http://moo.com/patch5', 'http://moo.com/patch6'] # } - # The final option is to return DATA, then put a diff after __END__ and you + # The final option is to return DATA, then put a diff after __END__. You # can still return a Hash with DATA as the value for a patch level key. def patches; end # reimplement and specify dependencies def deps; end # sometimes the clean process breaks things, return true to skip anything def skip_clean? path; false end + # rarely, you don't want your library symlinked into the main prefix + # see gettext.rb for an example + def keg_only?; false end # yields self with current working directory set to the uncompressed tarball def brew diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 3f887e99a..575fbe8f3 100755 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -6,6 +6,21 @@ require 'brew.h' show_summary_heading = false +def text_for_keg_only_formula f + <<-EOS +#{f.name} is keg-only. This means it is not symlinked into Homebrew's +prefix. The formula provides the following rationale: + +#{f.keg_only?} + +Generally there are no consequences of this for you, however if you build your +own software and it requires this formula, you may want to run this command to +link it into the Homebrew prefix: + + brew link #{f.name} + EOS +end + def install f build_time = nil @@ -71,14 +86,19 @@ def install f end end - begin - Keg.new(f.prefix).link - rescue Exception - onoe "The linking step did not complete successfully" - puts "The package built, but is not symlinked into #{HOMEBREW_PREFIX}" - puts "You can try again using `brew link #{f.name}'" - ohai e, e.inspect if ARGV.debug? + if f.keg_only? + ohai 'Caveats', text_for_keg_only_formula(f) show_summary_heading = true + else + begin + Keg.new(f.prefix).link + rescue Exception + onoe "The linking step did not complete successfully" + puts "The package built, but is not symlinked into #{HOMEBREW_PREFIX}" + puts "You can try again using `brew link #{f.name}'" + ohai e, e.inspect if ARGV.debug? + show_summary_heading = true + end end ohai "Summary" if ARGV.verbose? or show_summary_heading |
