From 26e4899fde482cafcb2d85212020a3b86882bf3e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 12 Oct 2016 15:37:33 +0100 Subject: [PATCH] Deprecate apr requirement. It's not used on enough configurations now that there's little point in keeping it around. See e.g. `:autoconf` for prior art. --- .../Homebrew/compat/dependency_collector.rb | 8 +++-- Library/Homebrew/compat/requirements.rb | 1 - Library/Homebrew/dependency_collector.rb | 1 - Library/Homebrew/dev-cmd/audit.rb | 4 +++ Library/Homebrew/requirements.rb | 1 - .../Homebrew/requirements/apr_requirement.rb | 32 ------------------- 6 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 Library/Homebrew/requirements/apr_requirement.rb diff --git a/Library/Homebrew/compat/dependency_collector.rb b/Library/Homebrew/compat/dependency_collector.rb index b18adc4901..bd72c55d4e 100644 --- a/Library/Homebrew/compat/dependency_collector.rb +++ b/Library/Homebrew/compat/dependency_collector.rb @@ -13,6 +13,10 @@ class DependencyCollector when :cairo, :fontconfig, :freetype, :libpng, :pixman output_deprecation(spec, tags) Dependency.new(spec.to_s, tags) + when :apr + # TODO: reenable in future when we've fixed a few of the audits. + # output_deprecation(spec, tags, "apr-util") + Dependency.new("apr-util", tags) when :libltdl tags << :run output_deprecation("libtool", tags) @@ -27,13 +31,13 @@ class DependencyCollector Dependency.new(spec.to_s, tags) end - def output_deprecation(dependency, tags) + def output_deprecation(dependency, tags, new_dependency = dependency) tags_string = if tags.length > 1 " => [:#{tags.join ", :"}]" elsif tags.length == 1 " => :#{tags.first}" end odeprecated "'depends_on :#{dependency}'", - "'depends_on \"#{dependency}\"#{tags_string}'" + "'depends_on \"#{new_dependency}\"#{tags_string}'" end end diff --git a/Library/Homebrew/compat/requirements.rb b/Library/Homebrew/compat/requirements.rb index 5c3c7a09c7..77760d1dc2 100644 --- a/Library/Homebrew/compat/requirements.rb +++ b/Library/Homebrew/compat/requirements.rb @@ -8,7 +8,6 @@ GPGRequirement = GPG2Requirement TeXDependency = TeXRequirement MercurialDependency = MercurialRequirement GitDependency = GitRequirement -AprDependency = AprRequirement FortranDependency = FortranRequirement JavaDependency = JavaRequirement LanguageModuleDependency = LanguageModuleRequirement diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 56463fa296..02c7819983 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -114,7 +114,6 @@ class DependencyCollector when :perl then PerlRequirement.new(tags) when :tuntap then TuntapRequirement.new(tags) when :ant then ant_dep(spec, tags) - when :apr then AprRequirement.new(tags) when :emacs then EmacsRequirement.new(tags) # Tiger's ld is too old to properly link some software when :ld64 then LD64Dependency.new if MacOS.version < :leopard diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index de53b02921..bfe56302ef 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -811,6 +811,10 @@ class FormulaAuditor problem ":#{$1} is deprecated. Usage should be \"#{$1}\"" end + if line =~ /depends_on :apr/ + problem ":apr is deprecated. Usage should be \"apr-util\"" + end + # Commented-out depends_on problem "Commented-out dep #{$1}" if line =~ /#\s*depends_on\s+(.+)\s*$/ diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb index 87b315cb76..b09dc889ad 100644 --- a/Library/Homebrew/requirements.rb +++ b/Library/Homebrew/requirements.rb @@ -1,5 +1,4 @@ require "requirement" -require "requirements/apr_requirement" require "requirements/fortran_requirement" require "requirements/gpg2_requirement" require "requirements/language_module_requirement" diff --git a/Library/Homebrew/requirements/apr_requirement.rb b/Library/Homebrew/requirements/apr_requirement.rb deleted file mode 100644 index edfad1752c..0000000000 --- a/Library/Homebrew/requirements/apr_requirement.rb +++ /dev/null @@ -1,32 +0,0 @@ -require "requirement" - -class AprRequirement < Requirement - fatal true - default_formula "apr-util" - - # APR shipped in Tiger is too old, but Leopard+ is usable. - # The *-config scripts were removed in Sierra, which is widely breaking. - satisfy(build_env: false) do - next false if MacOS.version <= :leopard - next false if MacOS.version >= :sierra - MacOS::CLT.installed? || Formula["apr-util"].installed? - end - - env do - next if MacOS.version <= :leopard - next if MacOS.version >= :sierra - next if MacOS::CLT.installed? - ENV.prepend_path "PATH", Formula["apr-util"].opt_bin - ENV.prepend_path "PATH", Formula["apr"].opt_bin - ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["apr"].opt_libexec}/lib/pkgconfig" - ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["apr-util"].opt_libexec}/lib/pkgconfig" - end - - def to_dependency - super.extend Module.new { - def tags - super - [:build] - end - } - end -end