From b66aafc218ecbf1b47b2f080e4447c5f28fdcc21 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 1 Jun 2018 14:01:34 +0100 Subject: [PATCH] runtime_dependencies: include recommended deps. These previously weren't being generated correctly for dependencies of formulae that weren't installed. --- Library/Homebrew/build_options.rb | 5 +++++ Library/Homebrew/formula.rb | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index 6c6952d710..8d9e349049 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -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 diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2e89d14197..fdb9fc1324 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -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