131 lines
5.4 KiB
Ruby
131 lines
5.4 KiB
Ruby
class Alot < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Text mode MUA using notmuch mail"
|
|
homepage "https://github.com/pazz/alot"
|
|
url "https://github.com/pazz/alot/archive/0.9.1.tar.gz"
|
|
sha256 "ee2c1ab1b43d022a8fe2078820ed57d8d72aec260a7d750776dac4ee841d1de4"
|
|
license "GPL-3.0"
|
|
revision 1
|
|
head "https://github.com/pazz/alot.git"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, big_sur: "dd103cfc441ae5b5b4d7897d5cbf9f7e25b54e300a8fa4c7dda89f9c2018bd2d"
|
|
sha256 cellar: :any_skip_relocation, catalina: "0520e61b1690100b7d07128228a5b3fb134e9376a41062e9dd1f09ee75fac0cf"
|
|
sha256 cellar: :any_skip_relocation, mojave: "3398a81c4ac4e39b95c2fcec3a856eac4a815f134fd580c762a58cc9e3ee761f"
|
|
sha256 cellar: :any_skip_relocation, high_sierra: "b12fe26e7ba15d224db24d07b06b8655f9d9fb856200c27fb74981a8eed938a8"
|
|
end
|
|
|
|
depends_on "sphinx-doc" => :build
|
|
depends_on "swig" => :build
|
|
depends_on "gpgme"
|
|
depends_on "libmagic"
|
|
depends_on "notmuch"
|
|
depends_on "python@3.9"
|
|
|
|
resource "attrs" do
|
|
url "https://files.pythonhosted.org/packages/98/c3/2c227e66b5e896e15ccdae2e00bbc69aa46e9a8ce8869cc5fa96310bf612/attrs-19.3.0.tar.gz"
|
|
sha256 "f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
|
|
end
|
|
|
|
resource "Automat" do
|
|
url "https://files.pythonhosted.org/packages/80/c5/82c63bad570f4ef745cc5c2f0713c8eddcd07153b4bee7f72a8dc9f9384b/Automat-20.2.0.tar.gz"
|
|
sha256 "7979803c74610e11ef0c0d68a2942b152df52da55336e0c9d58daf1831cbdf33"
|
|
end
|
|
|
|
resource "configobj" do
|
|
url "https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz"
|
|
sha256 "a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"
|
|
end
|
|
|
|
resource "constantly" do
|
|
url "https://files.pythonhosted.org/packages/95/f1/207a0a478c4bb34b1b49d5915e2db574cadc415c9ac3a7ef17e29b2e8951/constantly-15.1.0.tar.gz"
|
|
sha256 "586372eb92059873e29eba4f9dec8381541b4d3834660707faf8ba59146dfc35"
|
|
end
|
|
|
|
resource "hyperlink" do
|
|
url "https://files.pythonhosted.org/packages/e0/46/1451027b513a75edf676d25a47f601ca00b06a6a7a109e5644d921e7462d/hyperlink-19.0.0.tar.gz"
|
|
sha256 "4288e34705da077fada1111a24a0aa08bb1e76699c9ce49876af722441845654"
|
|
end
|
|
|
|
resource "idna" do
|
|
url "https://files.pythonhosted.org/packages/cb/19/57503b5de719ee45e83472f339f617b0c01ad75cba44aba1e4c97c2b0abd/idna-2.9.tar.gz"
|
|
sha256 "7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb"
|
|
end
|
|
|
|
resource "incremental" do
|
|
url "https://files.pythonhosted.org/packages/8f/26/02c4016aa95f45479eea37c90c34f8fab6775732ae62587a874b619ca097/incremental-17.5.0.tar.gz"
|
|
sha256 "7b751696aaf36eebfab537e458929e194460051ccad279c72b755a167eebd4b3"
|
|
end
|
|
|
|
resource "PyHamcrest" do
|
|
url "https://files.pythonhosted.org/packages/58/05/7b993fabb44ff0b52a90916d96bfd91a65ecf90b8248e72bba325ba8e438/PyHamcrest-2.0.2.tar.gz"
|
|
sha256 "412e00137858f04bde0729913874a48485665f2d36fe9ee449f26be864af9316"
|
|
end
|
|
|
|
resource "python-magic" do
|
|
url "https://files.pythonhosted.org/packages/84/30/80932401906eaf787f2e9bd86dc458f1d2e75b064b4c187341f29516945c/python-magic-0.4.15.tar.gz"
|
|
sha256 "f3765c0f582d2dfc72c15f3b5a82aecfae9498bd29ca840d72f37d7bd38bfcd5"
|
|
end
|
|
|
|
resource "six" do
|
|
url "https://files.pythonhosted.org/packages/21/9f/b251f7f8a76dec1d6651be194dfba8fb8d7781d10ab3987190de8391d08e/six-1.14.0.tar.gz"
|
|
sha256 "236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"
|
|
end
|
|
|
|
resource "Twisted" do
|
|
url "https://files.pythonhosted.org/packages/4a/b4/4973c7ccb5be2ec0abc779b7d5f9d5f24b17b0349e23240cfc9dc3bd83cc/Twisted-20.3.0.tar.bz2"
|
|
sha256 "d72c55b5d56e176563b91d11952d13b01af8725c623e498db5507b6614fc1e10"
|
|
end
|
|
|
|
resource "urwid" do
|
|
url "https://files.pythonhosted.org/packages/45/dd/d57924f77b0914f8a61c81222647888fbb583f89168a376ffeb5613b02a6/urwid-2.1.0.tar.gz"
|
|
sha256 "0896f36060beb6bf3801cb554303fef336a79661401797551ba106d23ab4cd86"
|
|
end
|
|
|
|
resource "urwidtrees" do
|
|
url "https://files.pythonhosted.org/packages/88/9d/981617fa083a75cf0b5ebb0ae47c3af6fb69183be1c74cc3ac6d9a0c5964/urwidtrees-1.0.1.1.tar.gz"
|
|
sha256 "08a66d0e76e94bc32bc590e35ed283e8a6b0c93adeb431dc576ec0a345f09bfd"
|
|
end
|
|
|
|
resource "zope.interface" do
|
|
url "https://files.pythonhosted.org/packages/af/d2/9675302d7ced7ec721481f4bbecd28a390a8db4ff753d28c64057b975396/zope.interface-5.1.0.tar.gz"
|
|
sha256 "40e4c42bd27ed3c11b2c983fecfb03356fae1209de10686d03c02c8696a1d90e"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
pkgshare.install Dir["extra/*"] - %w[extra/completion]
|
|
zsh_completion.install "extra/completion/alot-completion.zsh" => "_alot"
|
|
|
|
ENV["LC_ALL"] = "en_US.UTF-8"
|
|
ENV["SPHINXBUILD"] = Formula["sphinx-doc"].opt_bin/"sphinx-build"
|
|
cd "docs" do
|
|
system "make", "pickle"
|
|
system "make", "man", "html"
|
|
man1.install "build/man/alot.1"
|
|
doc.install Dir["build/html/*"]
|
|
end
|
|
end
|
|
|
|
test do
|
|
(testpath/".notmuch-config").write "[database]\npath=#{testpath}/Mail"
|
|
(testpath/"Mail").mkpath
|
|
system Formula["notmuch"].bin/"notmuch", "new"
|
|
|
|
begin
|
|
pid = fork do
|
|
$stdout.reopen("/dev/null")
|
|
$stdin.reopen("/dev/null")
|
|
exec "script", "-q", "/dev/null", bin/"alot", "--logfile", testpath/"out.log"
|
|
end
|
|
sleep 10
|
|
ensure
|
|
Process.kill 9, pid
|
|
end
|
|
|
|
assert_predicate testpath/"out.log", :exist?, "out.log file should exist"
|
|
assert_match "setup gui", File.read(testpath/"out.log")
|
|
end
|
|
end
|