class Alot < Formula include Language::Python::Virtualenv desc "Text mode MUA using notmuch mail" homepage "https://github.com/pazz/alot" # TODO: check if we can remove `standard-mailcap` from `pypi_packages` # https://github.com/pazz/alot/issues/1632 url "https://github.com/pazz/alot.git", tag: "v0.12", revision: "40a190f4c5f18c1283fdb3186393c4a778f865a5" license "GPL-3.0-only" head "https://github.com/pazz/alot.git", branch: "master" no_autobump! because: "`update-python-resources` cannot determine dependencies" bottle do sha256 cellar: :any_skip_relocation, arm64_tahoe: "bafe239bf49b35e9221611636ee2fdeb27ab6c87226cd361d6cc2db75d0ec1b2" sha256 cellar: :any_skip_relocation, arm64_sequoia: "9c32a9fc2edc767926054eec0088f7e046896a0ddb6db4fe81d8dcc6c3d2b6a3" sha256 cellar: :any_skip_relocation, arm64_sonoma: "df061f67b09ef2ba202ee591aa2494f8d28f67102e4ad12dde5857a0f4d03d4d" sha256 cellar: :any_skip_relocation, sonoma: "d2cf7be85bb47c92443c4d4073783ffe081bb1b516a3c71906ecae224119db89" sha256 cellar: :any_skip_relocation, arm64_linux: "5388543c998b2781ad298027a5c3b78747d68f2ec4b2f50b28f51d723b7445b2" sha256 cellar: :any_skip_relocation, x86_64_linux: "8a5d1724c70d5a0e9afb11d269cce3b395ce1d3e58ac2bbd6236968004d4f505" end depends_on "sphinx-doc" => :build depends_on "swig" => :build depends_on "gpgmepy" => :no_linkage depends_on "libmagic" => :no_linkage depends_on "notmuch" depends_on "python@3.14" pypi_packages exclude_packages: "notmuch2", extra_packages: "standard-mailcap" resource "attrs" do url "https://files.pythonhosted.org/packages/6b/5c/685e6633917e101e5dcb62b9dd76946cbb57c26e133bae9e0cd36033c0a9/attrs-25.4.0.tar.gz" sha256 "16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11" end resource "automat" do url "https://files.pythonhosted.org/packages/e3/0f/d40bbe294bbf004d436a8bcbcfaadca8b5140d39ad0ad3d73d1a8ba15f14/automat-25.4.16.tar.gz" sha256 "0017591a5477066e90d26b0e696ddc143baafd87b588cfac8100bc6be9634de0" end resource "configobj" do url "https://files.pythonhosted.org/packages/f5/c4/c7f9e41bc2e5f8eeae4a08a01c91b2aea3dfab40a3e14b25e87e7db8d501/configobj-5.0.9.tar.gz" sha256 "03c881bbf23aa07bccf1b837005975993c4ab4427ba57f959afdd9d1a2386848" end resource "constantly" do url "https://files.pythonhosted.org/packages/4d/6f/cb2a94494ff74aa9528a36c5b1422756330a75a8367bf20bd63171fc324d/constantly-23.10.4.tar.gz" sha256 "aa92b70a33e2ac0bb33cd745eb61776594dc48764b06c35e0efd050b7f1c7cbd" end resource "hyperlink" do url "https://files.pythonhosted.org/packages/3a/51/1947bd81d75af87e3bb9e34593a4cf118115a8feb451ce7a69044ef1412e/hyperlink-21.0.0.tar.gz" sha256 "427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b" end resource "idna" do url "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz" sha256 "795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902" end resource "incremental" do url "https://files.pythonhosted.org/packages/ef/3c/82e84109e02c492f382c711c58a3dd91badda6d746def81a1465f74dc9f5/incremental-24.11.0.tar.gz" sha256 "87d3480dbb083c1d736222511a8cf380012a8176c2456d01ef483242abbbcf8c" end resource "mock" do url "https://files.pythonhosted.org/packages/07/8c/14c2ae915e5f9dca5a22edd68b35be94400719ccfa068a03e0fb63d0f6f6/mock-5.2.0.tar.gz" sha256 "4e460e818629b4b173f32d08bf30d3af8123afbb8e04bb5707a1fd4799e503f0" end resource "python-magic" do url "https://files.pythonhosted.org/packages/da/db/0b3e28ac047452d079d375ec6798bf76a036a08182dbb39ed38116a49130/python-magic-0.4.27.tar.gz" sha256 "c1ba14b08e4a5f5c31a302b7721239695b2f0f058d125bd5ce1ee36b9d9d3c3b" end resource "setuptools" do url "https://files.pythonhosted.org/packages/18/5d/3bf57dcd21979b887f014ea83c24ae194cfcd12b9e0fda66b957c69d1fca/setuptools-80.9.0.tar.gz" sha256 "f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c" end resource "six" do url "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz" sha256 "ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81" end resource "standard-mailcap" do url "https://files.pythonhosted.org/packages/53/e8/672bd621c146b89667a2bfaa58a1384db13cdd62bb7722ddb8d672bf7a75/standard_mailcap-3.13.0.tar.gz" sha256 "19ed7955dbeaccb35e8bb05b2b5443ce55c1f932a8cbe7a5c13d42f9db4f499a" end resource "twisted" do url "https://files.pythonhosted.org/packages/13/0f/82716ed849bf7ea4984c21385597c949944f0f9b428b5710f79d0afc084d/twisted-25.5.0.tar.gz" sha256 "1deb272358cb6be1e3e8fc6f9c8b36f78eb0fa7c2233d2dbe11ec6fee04ea316" # Fix asyncio error with Python 3.14, remove in next release # PR ref: https://github.com/twisted/twisted/pull/12508 patch do url "https://github.com/twisted/twisted/commit/c8a4c700a71c283bd65faee69820f88ec97966cb.patch?full_index=1" sha256 "04b849f18e6ef01e7ee2903dba13ffa8bcb04c6d9c182d25410605320d819bd2" end patch do url "https://github.com/twisted/twisted/commit/69b81f9038eea5ef60c30a3460abb4cc26986f72.patch?full_index=1" sha256 "f999fc976327e955fbe82348dfd8c336925bc1f87cfaf4bd4c95deeb0570116d" end end resource "typing-extensions" do url "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz" sha256 "0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466" end resource "urwid" do url "https://files.pythonhosted.org/packages/e0/4d/f0832a6bf0986bdd770d61f9cf9e9915741171502c0c399bf934c72a3e5e/urwid-3.0.4.tar.gz" sha256 "c3d0d2f47602b21949ffb8669a7ef0a8ca5fa13ed5c1ee1d2d81edf05616187f" end resource "urwidtrees" do url "https://files.pythonhosted.org/packages/43/e1/ca5cf122cf1121b55acb39a1fb7e9fb1283c2eb0dc75fca751eb8c16b2f9/urwidtrees-1.0.3.tar.gz" sha256 "50b19c06b03a5a73e561757a26d449cfe0c08afabe5c0f3cd4435596bdddaae9" end resource "wcwidth" do url "https://files.pythonhosted.org/packages/24/30/6b0809f4510673dc723187aeaf24c7f5459922d01e2f794277a3dfb90345/wcwidth-0.2.14.tar.gz" sha256 "4d478375d31bc5395a3c55c40ccdf3354688364cd61c4f6adacaa9215d0b3605" end resource "zope-interface" do url "https://files.pythonhosted.org/packages/71/c9/5ec8679a04d37c797d343f650c51ad67d178f0001c363e44b6ac5f97a9da/zope_interface-8.1.1.tar.gz" sha256 "51b10e6e8e238d719636a401f44f1e366146912407b58453936b781a19be19ec" end def install venv = virtualenv_install_with_resources pkgshare.install Pathname("extra").children - [Pathname("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" ENV.prepend_path "PYTHONPATH", venv.site_packages cd "docs" do system "make", "pickle" system "make", "man", "html" man1.install "build/man/alot.1" doc.install Pathname("build/html").children end end test do (testpath/".notmuch-config").write <<~EOS [database] path=#{testpath}/Mail EOS (testpath/"Mail").mkpath system Formula["notmuch"].bin/"notmuch", "new" require "pty" PTY.spawn(bin/"alot", "--logfile", testpath/"out.log") do |_r, _w, pid| sleep 10 Process.kill 9, pid end assert_path_exists testpath/"out.log", "out.log file should exist" assert_match "setup gui", (testpath/"out.log").read end end