2015-11-17 20:49:10 +08:00
|
|
|
require "dependency_collector"
|
|
|
|
|
|
|
|
class DependencyCollector
|
|
|
|
alias_method :_parse_symbol_spec, :parse_symbol_spec
|
|
|
|
|
2015-11-16 23:18:31 +08:00
|
|
|
def parse_symbol_spec(spec, tags)
|
|
|
|
case spec
|
|
|
|
when :clt
|
2016-07-16 22:14:55 +01:00
|
|
|
odeprecated "'depends_on :clt'"
|
2015-11-16 23:18:31 +08:00
|
|
|
when :autoconf, :automake, :bsdmake, :libtool
|
2016-07-16 22:14:55 +01:00
|
|
|
output_deprecation(spec, tags)
|
2015-11-16 23:18:31 +08:00
|
|
|
autotools_dep(spec, tags)
|
|
|
|
when :cairo, :fontconfig, :freetype, :libpng, :pixman
|
2016-07-16 22:14:55 +01:00
|
|
|
output_deprecation(spec, tags)
|
2015-11-16 23:18:31 +08:00
|
|
|
Dependency.new(spec.to_s, tags)
|
|
|
|
when :libltdl
|
|
|
|
tags << :run
|
2016-07-16 22:14:55 +01:00
|
|
|
output_deprecation("libtool", tags)
|
2015-11-16 23:18:31 +08:00
|
|
|
Dependency.new("libtool", tags)
|
|
|
|
else
|
2015-11-17 20:49:10 +08:00
|
|
|
_parse_symbol_spec(spec, tags)
|
2015-11-16 23:18:31 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def autotools_dep(spec, tags)
|
|
|
|
tags << :build unless tags.include? :run
|
|
|
|
Dependency.new(spec.to_s, tags)
|
|
|
|
end
|
2016-07-16 22:14:55 +01:00
|
|
|
|
|
|
|
def output_deprecation(dependency, tags)
|
|
|
|
tags_string = if tags.length > 1
|
|
|
|
" => [:#{tags.join ", :"}]"
|
|
|
|
elsif tags.length == 1
|
|
|
|
" => :#{tags.first}"
|
|
|
|
end
|
|
|
|
odeprecated "'depends_on :#{dependency}'",
|
|
|
|
"'depends_on \"#{dependency}\"#{tags_string}'"
|
|
|
|
end
|
2015-11-16 23:18:31 +08:00
|
|
|
end
|