phinze/homebrew-cask

View on GitHub
Casks/p/perforce.rb

Summary

Maintainability
A
0 mins
Test Coverage
cask "perforce" do
  arch arm: "12arm64", intel: "1015x86_64"

  version "2024.1,2625008"
  sha256 arm:   "ec74a4d39b0f3bb30d8f24dc0b6450fbaa335f119245531b1e99273cdf66050b",
         intel: "5174ca8d62ccc1d803ef63111aa12ff55f82534aea2da19700dc02f57b08842d"

  url "https://filehost.perforce.com/perforce/r#{version.major[-2..]}.#{version.minor}/bin.macosx#{arch}/helix-core-server.tgz"
  name "Perforce Helix Core Server"
  name "Perforce Helix Command-Line Client (P4)"
  name "Perforce Helix Broker (P4Broker)"
  name "Perforce Helix Versioning Engine (P4D)"
  name "Perforce Helix Proxy (P4P)"
  desc "Version control"
  homepage "https://www.perforce.com/"

  livecheck do
    url "https://www.perforce.com/perforce/doc.current/user/relnotes.txt"
    regex(%r{\((\d+(?:\.\d+)+)/(\d+)\)}i)
    strategy :page_match do |page, regex|
      page.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
    end
  end

  conflicts_with cask: "p4"
  depends_on macos: ">= :sierra"

  binary "p4"
  binary "p4broker"
  binary "p4d"
  binary "p4p"

  # No zap stanza required

  caveats <<~EOS
    Instructions on using the Helix Versioning Engine are available in

      #{staged_path}
  EOS
end