Set cask and download DSL values on requirements.
Closes Homebrew/homebrew#35257. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
99ecc9ac34
commit
515395171c
@ -60,28 +60,20 @@ end
|
|||||||
|
|
||||||
class TeXDependency < Requirement
|
class TeXDependency < Requirement
|
||||||
fatal true
|
fatal true
|
||||||
|
cask "mactex"
|
||||||
|
download "http://www.tug.org/mactex/"
|
||||||
|
|
||||||
satisfy { which('tex') || which('latex') }
|
satisfy { which('tex') || which('latex') }
|
||||||
|
|
||||||
def message;
|
def message
|
||||||
if File.exist?("/usr/texbin")
|
s = <<-EOS.undent
|
||||||
texbin_path = "/usr/texbin"
|
A LaTeX distribution is required for Homebrew to install this formula.
|
||||||
else
|
|
||||||
texbin_path = "its bin directory"
|
|
||||||
end
|
|
||||||
|
|
||||||
<<-EOS.undent
|
Make sure that "/usr/texbin", or the location you installed it to, is in
|
||||||
A LaTeX distribution is required for Homebrew to install this formula.
|
your PATH before proceeding.
|
||||||
|
|
||||||
You can install MacTeX distribution with:
|
|
||||||
brew cask install mactex
|
|
||||||
|
|
||||||
Or from:
|
|
||||||
http://www.tug.org/mactex/
|
|
||||||
|
|
||||||
Make sure that "/usr/texbin", or the location you installed it to, is in
|
|
||||||
your PATH before proceeding.
|
|
||||||
EOS
|
EOS
|
||||||
|
s += super
|
||||||
|
s
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -120,6 +112,9 @@ end
|
|||||||
|
|
||||||
class JavaDependency < Requirement
|
class JavaDependency < Requirement
|
||||||
fatal true
|
fatal true
|
||||||
|
cask "java"
|
||||||
|
download "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
|
||||||
|
|
||||||
satisfy { java_version }
|
satisfy { java_version }
|
||||||
|
|
||||||
def initialize(tags)
|
def initialize(tags)
|
||||||
@ -136,15 +131,9 @@ class JavaDependency < Requirement
|
|||||||
def message
|
def message
|
||||||
version_string = " #{@version}" if @version
|
version_string = " #{@version}" if @version
|
||||||
|
|
||||||
<<-EOS.undent
|
s = "Java#{version_string} is required to install this formula."
|
||||||
Java#{version_string} is required to install this formula.
|
s += super
|
||||||
|
s
|
||||||
You can install the Java Development Kit (JDK) with:
|
|
||||||
brew cask install java
|
|
||||||
|
|
||||||
Or from:
|
|
||||||
http://www.oracle.com/technetwork/java/javase/downloads/index.html
|
|
||||||
EOS
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,9 @@ require "requirement"
|
|||||||
class OsxfuseDependency < Requirement
|
class OsxfuseDependency < Requirement
|
||||||
fatal true
|
fatal true
|
||||||
default_formula "osxfuse"
|
default_formula "osxfuse"
|
||||||
|
cask "osxfuse"
|
||||||
|
download "https://osxfuse"
|
||||||
|
|
||||||
satisfy { Formula["osxfuse"].installed? || self.class.binary_osxfuse_installed? }
|
satisfy { Formula["osxfuse"].installed? || self.class.binary_osxfuse_installed? }
|
||||||
|
|
||||||
def self.binary_osxfuse_installed?
|
def self.binary_osxfuse_installed?
|
||||||
@ -12,7 +15,6 @@ class OsxfuseDependency < Requirement
|
|||||||
env do
|
env do
|
||||||
ENV.append_path "PKG_CONFIG_PATH", HOMEBREW_PREFIX/"Library/ENV/pkgconfig/fuse"
|
ENV.append_path "PKG_CONFIG_PATH", HOMEBREW_PREFIX/"Library/ENV/pkgconfig/fuse"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class ConflictsWithBinaryOsxfuse < Requirement
|
class ConflictsWithBinaryOsxfuse < Requirement
|
||||||
|
|||||||
@ -3,6 +3,7 @@ require "language/python"
|
|||||||
class PythonDependency < Requirement
|
class PythonDependency < Requirement
|
||||||
fatal true
|
fatal true
|
||||||
default_formula "python"
|
default_formula "python"
|
||||||
|
cask "python"
|
||||||
|
|
||||||
satisfy :build_env => false do
|
satisfy :build_env => false do
|
||||||
python = which_python
|
python = which_python
|
||||||
@ -51,6 +52,7 @@ end
|
|||||||
class Python3Dependency < PythonDependency
|
class Python3Dependency < PythonDependency
|
||||||
fatal true
|
fatal true
|
||||||
default_formula "python3"
|
default_formula "python3"
|
||||||
|
cask "python3"
|
||||||
|
|
||||||
satisfy(:build_env => false) { which_python }
|
satisfy(:build_env => false) { which_python }
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ require "requirement"
|
|||||||
class TuntapDependency < Requirement
|
class TuntapDependency < Requirement
|
||||||
fatal true
|
fatal true
|
||||||
default_formula "tuntap"
|
default_formula "tuntap"
|
||||||
|
cask "tuntap"
|
||||||
satisfy { self.class.binary_tuntap_installed? || Formula["tuntap"].installed? }
|
satisfy { self.class.binary_tuntap_installed? || Formula["tuntap"].installed? }
|
||||||
|
|
||||||
def self.binary_tuntap_installed?
|
def self.binary_tuntap_installed?
|
||||||
|
|||||||
@ -5,6 +5,8 @@ class X11Dependency < Requirement
|
|||||||
attr_reader :min_version
|
attr_reader :min_version
|
||||||
|
|
||||||
fatal true
|
fatal true
|
||||||
|
cask "xquartz"
|
||||||
|
download "https://xquartz.macosforge.org"
|
||||||
|
|
||||||
env { ENV.x11 }
|
env { ENV.x11 }
|
||||||
|
|
||||||
@ -24,13 +26,10 @@ class X11Dependency < Requirement
|
|||||||
MacOS::XQuartz.installed? && min_version <= Version.new(MacOS::XQuartz.version)
|
MacOS::XQuartz.installed? && min_version <= Version.new(MacOS::XQuartz.version)
|
||||||
end
|
end
|
||||||
|
|
||||||
def message; <<-EOS.undent
|
def message
|
||||||
You can install XQuartz#{@min_version_string} with:
|
s = "XQuartz#{@min_version_string} is required to install this formula."
|
||||||
brew cask install xquartz
|
s += super
|
||||||
|
s
|
||||||
Or from:
|
|
||||||
https://xquartz.macosforge.org
|
|
||||||
EOS
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def <=> other
|
def <=> other
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user