aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat/dependency_collector.rb
blob: bce04d047fffb4d5f93dafff67da6f725827fa6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require "dependency_collector"

class DependencyCollector
  alias_method :_parse_symbol_spec, :parse_symbol_spec

  def parse_symbol_spec(spec, tags)
    case spec
    when :clt
    when :autoconf, :automake, :bsdmake, :libtool
      autotools_dep(spec, tags)
    when :cairo, :fontconfig, :freetype, :libpng, :pixman
      Dependency.new(spec.to_s, tags)
    when :libltdl
      tags << :run
      Dependency.new("libtool", tags)
    else
      _parse_symbol_spec(spec, tags)
    end
  end

  def autotools_dep(spec, tags)
    tags << :build unless tags.include? :run
    Dependency.new(spec.to_s, tags)
  end
end