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.
This commit is contained in:
		
							parent
							
								
									a812e95417
								
							
						
					
					
						commit
						26e4899fde
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -8,7 +8,6 @@ GPGRequirement             = GPG2Requirement
 | 
			
		||||
TeXDependency              = TeXRequirement
 | 
			
		||||
MercurialDependency        = MercurialRequirement
 | 
			
		||||
GitDependency              = GitRequirement
 | 
			
		||||
AprDependency              = AprRequirement
 | 
			
		||||
FortranDependency          = FortranRequirement
 | 
			
		||||
JavaDependency             = JavaRequirement
 | 
			
		||||
LanguageModuleDependency   = LanguageModuleRequirement
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
 | 
			
		||||
@ -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*$/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,4 @@
 | 
			
		||||
require "requirement"
 | 
			
		||||
require "requirements/apr_requirement"
 | 
			
		||||
require "requirements/fortran_requirement"
 | 
			
		||||
require "requirements/gpg2_requirement"
 | 
			
		||||
require "requirements/language_module_requirement"
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user