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

class MaximumMacOSRequirement < Requirement
  fatal true

  def initialize(tags)
    @version = MacOS::Version.from_symbol(tags.first)
    super
  end

  satisfy(build_env: false) { MacOS.version <= @version }

  def message
    <<~EOS
      This formula either does not compile or function as expected on macOS
      versions newer than #{@version.pretty_name} due to an upstream incompatibility.
    EOS
  end

  def display_s
    "macOS <= #{@version}"
  end
end