Allow missing libraries
This commit is contained in:
parent
f28f1f17e3
commit
e7b3b8e559
@ -1131,6 +1131,13 @@ class Formula
|
||||
end
|
||||
end
|
||||
|
||||
# Whether this {Formula} is allowed to have broken linkage.
|
||||
# Defaults to false.
|
||||
# @return [Boolean]
|
||||
def allow_missing_libs?
|
||||
false
|
||||
end
|
||||
|
||||
# Whether this {Formula} is deprecated (i.e. warns on installation).
|
||||
# Defaults to false.
|
||||
# @method deprecated?
|
||||
@ -2596,6 +2603,10 @@ class Formula
|
||||
@skip_clean_paths ||= Set.new
|
||||
end
|
||||
|
||||
def allow_missing_libs
|
||||
define_method(:allow_missing_libs?) { true }
|
||||
end
|
||||
|
||||
# Software that will not be symlinked into the `brew --prefix` will only
|
||||
# live in its Cellar. Other formulae can depend on it and then brew will
|
||||
# add the necessary includes and libs (etc.) during the brewing of that
|
||||
|
@ -59,14 +59,20 @@ class LinkageChecker
|
||||
display_items "Broken dependencies", @broken_deps, puts_output: puts_output
|
||||
display_items "Unwanted system libraries", @unwanted_system_dylibs, puts_output: puts_output
|
||||
display_items "Conflicting libraries", @version_conflict_deps, puts_output: puts_output
|
||||
puts "No broken library linkage" unless broken_library_linkage?
|
||||
if got_library_issues?
|
||||
puts "Broken library linkage ignored" if @formula.allow_missing_libs?
|
||||
else
|
||||
puts "No broken library linkage"
|
||||
end
|
||||
end
|
||||
|
||||
def broken_library_linkage?
|
||||
!@broken_dylibs.empty? ||
|
||||
!@broken_deps.empty? ||
|
||||
!@unwanted_system_dylibs.empty? ||
|
||||
!@version_conflict_deps.empty?
|
||||
!@formula.allow_missing_libs? && got_library_issues?
|
||||
end
|
||||
|
||||
def got_library_issues?
|
||||
issues = [@broken_dylibs, @broken_deps, @unwanted_system_dylibs, @version_conflict_deps]
|
||||
issues.any?(&:present?)
|
||||
end
|
||||
|
||||
private
|
||||
|
Loading…
x
Reference in New Issue
Block a user