Use fatal DSL method in requirements

master
Jack Nagel 2013-01-18 19:30:43 -06:00
parent 289fa0df20
commit 041c9c193f
19 changed files with 43 additions and 75 deletions

View File

@ -1,12 +1,11 @@
require 'formula'
class LionOrNewer < Requirement
fatal true
def satisfied?
MacOS.version >= :lion
end
def fatal?
true
end
def message
"Appledoc requires Mac OS X 10.7 (Lion) or newer."
end

View File

@ -1,6 +1,8 @@
require 'formula'
class JdkInstalled < Requirement
fatal true
def message; <<-EOS.undent
A JDK is required.
@ -12,10 +14,6 @@ class JdkInstalled < Requirement
def satisfied?
which 'javac'
end
def fatal?
true
end
end
class Avian < Formula

View File

@ -1,6 +1,8 @@
require 'formula'
class HomebrewedPython < Requirement
fatal true
def message; <<-EOS.undent
Compiling against the system-provided Python will likely fail.
The system-provided Python includes PPC support, which will cause a compiler
@ -12,9 +14,6 @@ class HomebrewedPython < Requirement
def satisfied?
Formula.factory('python').installed?
end
def fatal?
false
end
end
class CmuSphinxbase < Formula

View File

@ -1,6 +1,8 @@
require 'formula'
class TransitionalMode < Requirement
fatal true
def message; <<-EOS.undent
camlp5 must be compiled in transitional mode (instead of --strict mode):
brew install camlp5
@ -12,9 +14,6 @@ class TransitionalMode < Requirement
# If installed, make sure it is transitional instead of strict.
`camlp5 -pmode 2>&1`.chomp == 'transitional'
end
def fatal?
true
end
end
class Coq < Formula

View File

@ -1,6 +1,8 @@
require 'formula'
class PythonWithGdbm < Requirement
fatal true
def message; <<-EOS.undent
The Python being used does not include gdbm support,
but it is required to build this formula:
@ -14,10 +16,6 @@ class PythonWithGdbm < Requirement
def satisfied?
quiet_system "python", "-c", "import gdbm"
end
def fatal?
true
end
end
class Cvs2svn < Formula

View File

@ -1,15 +1,13 @@
require 'formula'
class PopplerQt4 < Requirement
fatal true
def satisfied?
poppler = Tab.for_formula 'poppler'
poppler.installed_with? '--with-qt4'
end
def fatal?
true
end
def message; <<-EOS.undent
DiffPDF requires the Poppler-Qt4 bindings but Poppler was not installed
with support for Qt. Please reinstall Poppler using the `--with-qt4`

View File

@ -1,6 +1,8 @@
require 'formula'
class ErlangInstalled < Requirement
fatal true
def message; <<-EOS.undent
Erlang is required to install.
@ -15,10 +17,6 @@ class ErlangInstalled < Requirement
def satisfied?
which 'erl'
end
def fatal?
true
end
end
class Elixir < Formula

View File

@ -1,6 +1,8 @@
require 'formula'
class EucjpMecabIpadic < Requirement
fatal true
def initialize
@mecab_ipadic_installed = Formula.factory('mecab-ipadic').installed?
end
@ -9,10 +11,6 @@ class EucjpMecabIpadic < Requirement
@mecab_ipadic_installed && mecab_dic_charset == 'euc'
end
def fatal?
true
end
def message
if @mecab_ipadic_installed
<<-EOS.undent

View File

@ -1,12 +1,12 @@
require 'formula'
class SixtyFourBitRequired < Requirement
fatal true
def satisfied?
MacOS.prefer_64_bit?
end
def fatal?; true end
def message; <<-EOS.undent
32-bit MongoDB binaries are no longer available.

View File

@ -1,14 +1,12 @@
require 'formula'
class NeedsSnowLeopard < Requirement
fatal true
def satisfied?
MacOS.version >= :snow_leopard
end
def fatal?
true
end
def message; <<-EOS.undent
The version of Freetype that comes with Leopard is too old to build MuPDF
against. It is possible to get MuPDF working on Leopard using the Freetype

View File

@ -1,6 +1,8 @@
require 'formula'
class MySqlInstalled < Requirement
fatal true
def message; <<-EOS.undent
MySQL is required to install.
@ -18,9 +20,6 @@ class MySqlInstalled < Requirement
def satisfied?
which 'mysql_config'
end
def fatal?
true
end
end
class MysqlConnectorOdbc < Formula

View File

@ -1,15 +1,14 @@
require 'formula'
class NeedsLion < Requirement
fatal true
def satisfied?
MacOS.version >= :lion
end
def message
"Nu requires Mac OS X 10.7 or newer"
end
def fatal?
true
end
end
class Nu < Formula

View File

@ -1,15 +1,13 @@
require 'formula'
class PopplerGlib < Requirement
fatal true
def satisfied?
poppler = Tab.for_formula 'poppler'
poppler.installed_with? '--with-glib'
end
def fatal?
true
end
def message; <<-EOS.undent
pdf2svg requires the Poppler-Glib bindings but Poppler was not installed
with support for glib. Please reinstall Poppler using the `--with-glib`

View File

@ -9,6 +9,8 @@ class Pygments < Formula
end
class MarkdownProvider < Requirement
fatal true
def message; <<-EOS.undent
shocco requires a `markdown` command.
@ -23,10 +25,6 @@ class MarkdownProvider < Requirement
def satisfied?
which 'markdown'
end
def fatal?
true
end
end
class Shocco < Formula

View File

@ -1,6 +1,8 @@
require 'formula'
class GnupgInstalled < Requirement
fatal true
def message; <<-EOS.undent
Gnupg is required to use these tools.
@ -16,10 +18,6 @@ class GnupgInstalled < Requirement
def satisfied?
which 'gpg' or which 'gpg2'
end
def fatal?
false
end
end
class SigningParty < Formula

View File

@ -1,6 +1,9 @@
require 'formula'
class NoBdb5 < Requirement
# Not fatal in case Squid starts working with a newer version of BDB.
fatal false
def message; <<-EOS.undent
This software can fail to compile when Berkeley-DB 5.x is installed.
You may need to try:
@ -14,11 +17,6 @@ class NoBdb5 < Requirement
f = Formula.factory("berkeley-db")
not f.installed?
end
# Not fatal in case Squid starts working with a newer version of BDB.
def fatal?
false
end
end
class Squid < Formula

View File

@ -7,16 +7,14 @@ def build_ruby?; build.include? "ruby"; end
def with_unicode_path?; build.include? "unicode-path"; end
class UniversalNeon < Requirement
fatal true
def message; <<-EOS.undent
A universal build was requested, but neon was already built for a single arch.
You will need to `brew rm neon` first.
EOS
end
def fatal?
true
end
def satisfied?
f = Formula.factory('neon')
!f.installed? || archs_for_command(f.lib+'libneon.dylib').universal?
@ -24,16 +22,14 @@ class UniversalNeon < Requirement
end
class UniversalSqlite < Requirement
fatal true
def message; <<-EOS.undent
A universal build was requested, but sqlite was already built for a single arch.
You will need to `brew rm sqlite` first.
EOS
end
def fatal?
true
end
def satisfied?
f = Formula.factory('sqlite')
!f.installed? || archs_for_command(f.lib+'libsqlite3.dylib').universal?
@ -41,16 +37,14 @@ class UniversalSqlite < Requirement
end
class UniversalSerf < Requirement
fatal true
def message; <<-EOS.undent
A universal build was requested, but serf was already built for a single arch.
You will need to `brew rm serf` first.
EOS
end
def fatal?
true
end
def satisfied?
f = Formula.factory('serf')
!f.installed? || archs_for_command(f.lib+'libserf-1.0.0.0.dylib').universal?

View File

@ -1,6 +1,8 @@
require 'formula'
class UniversalPcre < Requirement
fatal true
def message; <<-EOS.undent
pcre must be build universal for uwsgi to work.
You will need to:
@ -9,10 +11,6 @@ class UniversalPcre < Requirement
EOS
end
def fatal?
true
end
def satisfied?
f = Formula.factory('pcre')
f.installed? && archs_for_command(f.lib/'libpcre.dylib').universal?

View File

@ -1,6 +1,8 @@
require 'formula'
class FrameworkPython < Requirement
fatal true
def message; <<-EOS.undent
Python needs to be built as a framework.
EOS
@ -9,7 +11,6 @@ class FrameworkPython < Requirement
q = `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"`
not q.chomp.empty?
end
def fatal?; true; end
end
class Wxmac < Formula