homebrew-core/Formula/salt.rb

94 lines
3.4 KiB
Ruby

class Salt < Formula
include Language::Python::Virtualenv
desc "Dynamic infrastructure communication bus"
homepage "https://s.saltstack.com/community/"
url "https://files.pythonhosted.org/packages/b5/45/a20ff8a3cad48b50a924ee9c65f2df0e214de4fa282c4feef2e1d6a0b886/salt-3002.2.tar.gz"
sha256 "bd6d29621ce8e099412777cd396af35474aa112bb0999b5da804387d87290075"
license "Apache-2.0"
head "https://github.com/saltstack/salt.git", branch: "develop", shallow: false
livecheck do
url :stable
end
bottle do
sha256 "3b8936ee7fc3a11051f131b8c665320c37b06b4487797c1e3b6980f871d02fa9" => :big_sur
sha256 "c669635717b6bd34e3540d97d71e6eeaa357eab209b7a8857b0190da73d193f6" => :catalina
sha256 "bbc802eb5097a9f2d02b182215ca73eb37bdd841972e321bcaac219c2b530431" => :mojave
end
depends_on "swig" => :build
depends_on "libgit2"
depends_on "libyaml"
depends_on "openssl@1.1"
depends_on "python@3.9"
depends_on "zeromq"
on_linux do
depends_on "pkg-config" => :build
end
# Homebrew installs optional dependencies: M2Crypto, pygit2
resource "cached-property" do
url "https://files.pythonhosted.org/packages/61/2c/d21c1c23c2895c091fa7a91a54b6872098fea913526932d21902088a7c41/cached-property-1.5.2.tar.gz"
sha256 "9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/cb/ae/380e33d621ae301770358eb11a896a34c34f30db188847a561e8e39ee866/cffi-1.14.3.tar.gz"
sha256 "f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591"
end
resource "M2Crypto" do
url "https://files.pythonhosted.org/packages/ff/df/84609ed874b5e6fcd3061a517bf4b6e4d0301f553baf9fa37bef2b509797/M2Crypto-0.36.0.tar.gz"
sha256 "1542c18e3ee5c01db5031d0b594677536963e3f54ecdf5315aeecb3a595b4dc1"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/0f/86/e19659527668d70be91d0369aeaa055b4eb396b0f387a4f92293a20035bd/pycparser-2.20.tar.gz"
sha256 "2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"
end
resource "pygit2" do
url "https://files.pythonhosted.org/packages/3a/42/f69de8c7a1e33f365a91fa39093f4e7a64609c2bd127203536edc813cbf7/pygit2-1.4.0.tar.gz"
sha256 "cbeb38ab1df9b5d8896548a11e63aae8a064763ab5f1eabe4475e6b8a78ee1c8"
end
def install
python = Formula["python@3.9"].bin/"python3.9"
xy = Language::Python.major_minor_version python
ENV["SWIG_FEATURES"]="-I#{Formula["openssl@1.1"].opt_include}"
ENV["USE_STATIC_REQUIREMENTS"] = "1"
# Do not install PyObjC since it causes broken linkage
# https://github.com/Homebrew/homebrew-core/pull/52835#issuecomment-617502578
inreplace buildpath/"requirements/static/pkg/py#{xy}/darwin.txt", /^pyobjc.*$/, ""
venv = virtualenv_create(libexec, python)
venv.pip_install resources
system libexec/"bin/pip", "install", "-v", "--ignore-installed", buildpath
system libexec/"bin/pip", "uninstall", "-y", "salt"
venv.pip_install_and_link buildpath
prefix.install libexec/"share" # man pages
(etc/"saltstack").install (buildpath/"conf").children # sample config files
end
def caveats
<<~EOS
Sample configuration files have been placed in #{etc}/saltstack.
Saltstack will not use these by default.
Homebrew's installation does not include PyObjC.
EOS
end
test do
assert_match version.to_s, shell_output("#{bin}/salt --version")
end
end