homebrew-core/Formula/alot.rb
2018-03-21 10:41:23 +01:00

128 lines
5.1 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.7.tar.gz"
sha256 "2d49a7d61241cfadc993a8456076605b2cfe264c51f5e3f18f337bad58f29a1c"
revision 1
head "https://github.com/pazz/alot.git"
bottle do
cellar :any
sha256 "79c1bdd07fa75983d06f4a6c27e81741d0553e3635dd3836c65dc6f3c08c0954" => :high_sierra
sha256 "227895c908fda25c07555e5514b067d086d6d961f71a40c2098763cfd63deccd" => :sierra
sha256 "ba94977585c50e29025be7e592a31809d2f520d50fdb8f023a445dc78ca1bd9d" => :el_capitan
end
option "without-sphinx-doc", "Don't build documentation"
depends_on "swig" => :build
depends_on "gpgme"
depends_on "libmagic"
depends_on "notmuch"
depends_on "python@2" if MacOS.version <= :snow_leopard
depends_on "sphinx-doc" => [:build, :recommended]
resource "Automat" do
url "https://files.pythonhosted.org/packages/de/05/b8e453085cf8a7f27bb1226596f4ccf5cc9e758377d60284f990bbdc592c/Automat-0.6.0.tar.gz"
sha256 "3c1fd04ecf08ac87b4dd3feae409542e9bf7827257097b2b6ed5692f69d6f6a8"
end
resource "attrs" do
url "https://files.pythonhosted.org/packages/be/41/e909cb6d901e9689da947419505cc7fb7d242a08a62ee221fce6a009a523/attrs-17.2.0.tar.gz"
sha256 "5d4d1b99f94d69338f485984127e4473b3ab9e20f43821b0e546cc3b2302fd11"
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/83/df/3bdaf38f21f93429de02f04c6a967d2154955fc5b9a6a1a0b20a682edc13/hyperlink-17.3.1.tar.gz"
sha256 "bc4ffdbde9bdad204d507bd8f554f16bba82dd356f6130cb16f41422909c33bc"
end
resource "incremental" do
url "https://files.pythonhosted.org/packages/8f/26/02c4016aa95f45479eea37c90c34f8fab6775732ae62587a874b619ca097/incremental-17.5.0.tar.gz"
sha256 "7b751696aaf36eebfab537e458929e194460051ccad279c72b755a167eebd4b3"
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/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
end
resource "Twisted" do
url "https://files.pythonhosted.org/packages/a2/37/298f9547606c45d75aa9792369302cc63aa4bbcf7b5f607560180dd099d2/Twisted-17.9.0.tar.bz2"
sha256 "0da1a7e35d5fcae37bc9c7978970b5feb3bc82822155b8654ec63925c05af75c"
end
resource "urwid" do
url "https://files.pythonhosted.org/packages/c7/90/415728875c230fafd13d118512bde3184d810d7bf798a631abc05fac09d0/urwid-2.0.1.tar.gz"
sha256 "644d3e3900867161a2fc9287a9762753d66bd194754679adb26aede559bcccbc"
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/bd/d2/25349ed41f9dcff7b3baf87bd88a4c82396cf6e02f1f42bb68657a3132af/zope.interface-4.4.3.tar.gz"
sha256 "d6d26d5dfbfd60c65152938fcb82f949e8dada37c041f72916fef6621ba5c5ce"
end
def install
virtualenv_install_with_resources
pkgshare.install Dir["extra/*"] - %w[extra/completion]
zsh_completion.install "extra/completion/alot-completion.zsh" => "_alot"
if build.with? "sphinx-doc"
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
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