runtime_dependencies: include recommended deps.

These previously weren't being generated correctly for dependencies of
formulae that weren't installed.
This commit is contained in:
Mike McQuaid 2018-06-01 14:01:34 +01:00
parent fb0f979279
commit b66aafc218
2 changed files with 11 additions and 1 deletions

View File

@ -83,6 +83,11 @@ class BuildOptions
include?("c++11") && option_defined?("c++11")
end
# True if the build has any arguments or options specified.
def any_args_or_options?
!@args.empty? || !@options.empty?
end
# @private
def used_options
@options & @args

View File

@ -1525,7 +1525,12 @@ class Formula
def declared_runtime_dependencies
recursive_dependencies do |_, dependency|
Dependency.prune if dependency.build?
Dependency.prune if !dependency.required? && build.without?(dependency)
next if dependency.required?
if build.any_args_or_options?
Dependency.prune if build.without?(dependency)
elsif !dependency.recommended?
Dependency.prune
end
end
end