brew/Library/Homebrew/requirements/fortran_dependency.rb
Tim D. Smith c803b3d967 FortranDependency: make sure gfortran ends up in PATH
Per requirements.rb:

    >  XXX If the satisfy block returns a Pathname, then make sure that it
    >  remains available on the PATH. This makes requirements like
    >    satisfy { which("executable") }
    >  work, even under superenv where "executable" wouldn't normally be on the
    >  PATH.
    >  This is undocumented magic and it should be removed, but we need to add
    >  a way to declare path-based requirements that work with superenv first.

Fixes homebrew/homebrew-python#170.

Closes Homebrew/homebrew#38448.
2015-04-08 09:01:23 -07:00

14 lines
201 B
Ruby

require 'requirement'
class FortranDependency < Requirement
fatal true
default_formula 'gcc'
env { ENV.fortran }
satisfy :build_env => false do
which(ENV["FC"] || "gfortran")
end
end