aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat/formula.rb
blob: ee948572e251e9712c063f7be1fa125a87bb5357 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module FormulaCompat
  def x11_installed?
    MacOS::X11.installed?
  end

  def snow_leopard_64?
    MacOS.prefer_64_bit?
  end
end

class Formula
  include FormulaCompat
  extend FormulaCompat

  def std_cmake_parameters
    "-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev"
  end

  def cxxstdlib_check(check_type)
    self.class.cxxstdlib_check check_type
  end

  def self.bottle_sha1(*)
  end

  def self.all
    opoo "Formula.all is deprecated, use Formula.map instead"
    map
  end

  def self.canonical_name(name)
    Formulary.canonical_name(name)
  end

  def self.class_s(name)
    Formulary.class_s(name)
  end

  def self.factory(name)
    Formulary.factory(name)
  end

  def self.require_universal_deps
    define_method(:require_universal_deps?) { true }
  end

  def self.path(name)
    Formulary.core_path(name)
  end

  DATA = :DATA

  def patches
    {}
  end

  def python(_options = {}, &block)
    opoo "Formula#python is deprecated and will go away shortly."
    block.call if block_given?
    PythonRequirement.new
  end
  alias_method :python2, :python
  alias_method :python3, :python
end