2013-01-26 20:05:39 -06:00
|
|
|
require 'requirement'
|
2013-06-23 18:35:20 -07:00
|
|
|
require 'requirements/fortran_dependency'
|
2013-04-02 15:33:35 -05:00
|
|
|
require 'requirements/language_module_dependency'
|
2013-09-14 11:48:48 +01:00
|
|
|
require 'requirements/minimum_macos_requirement'
|
2013-04-02 15:33:35 -05:00
|
|
|
require 'requirements/mpi_dependency'
|
2014-08-29 14:05:12 -05:00
|
|
|
require 'requirements/osxfuse_dependency'
|
2013-01-21 10:33:56 +01:00
|
|
|
require 'requirements/python_dependency'
|
2013-06-23 18:35:20 -07:00
|
|
|
require 'requirements/x11_dependency'
|
2012-10-24 18:06:00 -05:00
|
|
|
|
2012-10-24 18:17:43 -05:00
|
|
|
class XcodeDependency < Requirement
|
2012-12-23 19:44:15 -06:00
|
|
|
fatal true
|
2012-10-24 18:06:00 -05:00
|
|
|
|
2013-01-19 20:45:59 -06:00
|
|
|
satisfy(:build_env => false) { MacOS::Xcode.installed? }
|
2012-10-24 18:06:00 -05:00
|
|
|
|
2013-10-23 17:44:43 +01:00
|
|
|
def message
|
|
|
|
message = <<-EOS.undent
|
|
|
|
A full installation of Xcode.app is required to compile this software.
|
|
|
|
Installing just the Command Line Tools is not sufficient.
|
2012-10-24 18:06:00 -05:00
|
|
|
EOS
|
2013-10-23 17:44:43 +01:00
|
|
|
if MacOS.version >= :lion
|
|
|
|
message += <<-EOS.undent
|
|
|
|
Xcode can be installed from the App Store.
|
|
|
|
EOS
|
|
|
|
else
|
|
|
|
message += <<-EOS.undent
|
|
|
|
Xcode can be installed from https://developer.apple.com/downloads/
|
|
|
|
EOS
|
|
|
|
end
|
2012-10-24 18:06:00 -05:00
|
|
|
end
|
|
|
|
end
|
2012-11-05 20:03:26 -06:00
|
|
|
|
2013-02-12 16:24:30 -06:00
|
|
|
class MysqlDependency < Requirement
|
2012-12-23 19:44:15 -06:00
|
|
|
fatal true
|
2013-05-10 13:35:38 +01:00
|
|
|
default_formula 'mysql'
|
2012-11-05 20:03:26 -06:00
|
|
|
|
2013-01-19 20:45:59 -06:00
|
|
|
satisfy { which 'mysql_config' }
|
2012-11-05 20:03:26 -06:00
|
|
|
end
|
|
|
|
|
2013-02-12 16:24:30 -06:00
|
|
|
class PostgresqlDependency < Requirement
|
2012-12-23 19:44:15 -06:00
|
|
|
fatal true
|
2013-06-02 17:14:42 -05:00
|
|
|
default_formula 'postgresql'
|
2012-11-05 20:03:26 -06:00
|
|
|
|
2013-01-19 20:45:59 -06:00
|
|
|
satisfy { which 'pg_config' }
|
2012-11-05 20:03:26 -06:00
|
|
|
end
|
2012-12-13 22:23:06 -08:00
|
|
|
|
2013-02-12 16:24:30 -06:00
|
|
|
class TeXDependency < Requirement
|
2012-12-13 22:23:06 -08:00
|
|
|
fatal true
|
|
|
|
|
2013-01-19 20:45:59 -06:00
|
|
|
satisfy { which('tex') || which('latex') }
|
2012-12-13 22:23:06 -08:00
|
|
|
|
2014-04-21 08:30:40 +02:00
|
|
|
def message;
|
|
|
|
if File.exist?("/usr/texbin")
|
|
|
|
texbin_path = "/usr/texbin"
|
|
|
|
else
|
|
|
|
texbin_path = "its bin directory"
|
|
|
|
end
|
|
|
|
|
|
|
|
<<-EOS.undent
|
2014-06-03 17:20:00 -04:00
|
|
|
A LaTeX distribution is required for Homebrew to install this formula.
|
2012-12-13 22:23:06 -08:00
|
|
|
|
|
|
|
You can install MacTeX distribution from:
|
|
|
|
http://www.tug.org/mactex/
|
|
|
|
|
2014-04-21 08:30:40 +02:00
|
|
|
Make sure that "/usr/texbin", or the location you installed it to, is in
|
|
|
|
your PATH before proceeding.
|
2012-12-13 22:23:06 -08:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
2013-01-23 00:26:30 -06:00
|
|
|
|
2013-04-01 11:53:13 -05:00
|
|
|
class ArchRequirement < Requirement
|
|
|
|
fatal true
|
|
|
|
|
|
|
|
def initialize(arch)
|
2013-05-06 22:49:31 -05:00
|
|
|
@arch = arch.pop
|
2013-04-01 11:53:13 -05:00
|
|
|
super
|
|
|
|
end
|
|
|
|
|
|
|
|
satisfy do
|
|
|
|
case @arch
|
|
|
|
when :x86_64 then MacOS.prefer_64_bit?
|
2013-08-01 19:57:05 -07:00
|
|
|
when :intel, :ppc then Hardware::CPU.type == @arch
|
2013-04-01 11:53:13 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-04-02 15:33:35 -05:00
|
|
|
def message
|
|
|
|
"This formula requires an #{@arch} architecture."
|
2013-04-01 11:53:13 -05:00
|
|
|
end
|
|
|
|
end
|
2013-04-17 10:01:38 -07:00
|
|
|
|
|
|
|
class MercurialDependency < Requirement
|
|
|
|
fatal true
|
2013-05-10 13:35:38 +01:00
|
|
|
default_formula 'mercurial'
|
2013-04-17 10:01:38 -07:00
|
|
|
|
|
|
|
satisfy { which('hg') }
|
|
|
|
end
|
2013-09-28 16:37:05 -05:00
|
|
|
|
|
|
|
class GitDependency < Requirement
|
|
|
|
fatal true
|
|
|
|
default_formula 'git'
|
2014-03-13 18:07:11 -05:00
|
|
|
satisfy { !!which('git') }
|
2013-09-28 16:37:05 -05:00
|
|
|
end
|
2014-07-21 02:11:08 -07:00
|
|
|
|
|
|
|
class JavaDependency < Requirement
|
|
|
|
fatal true
|
|
|
|
satisfy { java_version }
|
|
|
|
|
|
|
|
def initialize(tags)
|
|
|
|
@version = tags.pop
|
|
|
|
super
|
|
|
|
end
|
|
|
|
|
|
|
|
def java_version
|
2014-09-11 23:25:18 -05:00
|
|
|
args = %w[/usr/libexec/java_home --failfast]
|
|
|
|
args << "--version" << "#{@version}+" if @version
|
|
|
|
quiet_system(*args)
|
2014-07-21 02:11:08 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
|
|
|
version_string = " #{@version}" if @version
|
|
|
|
|
|
|
|
<<-EOS.undent
|
|
|
|
Java#{version_string} is required for Homebrew to install this formula.
|
|
|
|
|
|
|
|
You can install Java from:
|
|
|
|
http://www.oracle.com/technetwork/java/javase/downloads/index.html
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|