homebrew-core/Formula/alot.rb

134 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.tar.gz"
sha256 "64bfa2f550d775940348c93532bf5cbdde57b9fcec4bcf2447a72510d2add6cf"
head "https://github.com/pazz/alot.git"
bottle do
cellar :any
sha256 "b1f5acb12aa83910718353a750f6054de3e55b3fcb45fd1dec39c2d2d3731318" => :catalina
sha256 "d2e3a95111e7d768b15916f996fb29a356e46d37c1921ee71473a9f1db8801dc" => :mojave
sha256 "4bd27e704c084440d4151c02a9650c04c7ef235add26cf3510dd32066032959e" => :high_sierra
end
depends_on "sphinx-doc" => :build
depends_on "swig" => :build
depends_on "gpgme"
depends_on "libmagic"
depends_on "notmuch"
depends_on "python"
resource "Automat" do
url "https://files.pythonhosted.org/packages/4c/9a/3052851fa3a888d1ff32f053fba424ed929b47383fb5327855fdf70018cd/Automat-0.8.0.tar.gz"
sha256 "269a09dfb063a3b078983f4976d83f0a0d3e6e7aaf8e27d8df1095e09dc4a484"
end
resource "attrs" do
url "https://files.pythonhosted.org/packages/98/c3/2c227e66b5e896e15ccdae2e00bbc69aa46e9a8ce8869cc5fa96310bf612/attrs-19.3.0.tar.gz"
sha256 "f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
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 "gpg" do
url "https://files.pythonhosted.org/packages/ef/86/c5a34243a932346c59cb25eb49a4d1dec227974209eb9b618d0ed57ea5be/gpg-1.10.0.tar.gz"
sha256 "349214a866c84aa548bc35ed14eccd2ec9085b3958d5753a63a19a71a1f523ca"
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/ad/13/eb56951b6f7950cadb579ca166e448ba77f9d24efc03edd7e55fa57d04b7/idna-2.8.tar.gz"
sha256 "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407"
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/eb/3f/3b762dbc1a66494d9ef4562d24e0b1eb0b57dfa74124ef69f3eb2dd2eaaa/PyHamcrest-2.0.0.tar.gz"
sha256 "5959cb4ab465b303522d2e0d270a6ee581c3ad9ba419e304bb6ebe50a60ea37a"
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/0b/95/5fff90cd4093c79759d736e5f7c921c8eb7e5057a70d753cdb4e8e5895d7/Twisted-19.10.0.tar.bz2"
sha256 "7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d"
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/c3/05/bf3130eb799548882ce61b7c3d2dbc5d4d5cc6e821efa8786c5273d56844/zope.interface-4.7.1.tar.gz"
sha256 "4bb937e998be9d5e345f486693e477ba79e4344674484001a0b646be1d530487"
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