homebrew-core/Formula/mutt.rb

101 lines
3.2 KiB
Ruby

# NOTE: Mutt has a large number of non-upstream patches available for
# it, some of which conflict with each other. These patches are also
# not kept up-to-date when new versions of mutt (occasionally) come
# out.
#
# To reduce Homebrew's maintenance burden, patches are not accepted
# for this formula. The NeoMutt project has a Homebrew tap for their
# patched version of Mutt: https://github.com/neomutt/homebrew-neomutt
class Mutt < Formula
desc "Mongrel of mail user agents (part elm, pine, mush, mh, etc.)"
homepage "http://www.mutt.org/"
url "https://bitbucket.org/mutt/mutt/downloads/mutt-2.2.1.tar.gz"
sha256 "b76d30d42b6c90aa9abf9f330e41800934eedf7b858a32c120ee3ae63587abb5"
license "GPL-2.0-or-later"
bottle do
sha256 arm64_monterey: "70f5767b0663889d58a8db45ce74c53fd18533512587ca5f5cb571f0f53af23a"
sha256 arm64_big_sur: "b35a1ea5b08d639973374280d48a670c60a78ed940166894eea151c163195738"
sha256 monterey: "ce6e6323b844405203e290d8794a97ef9ae7bb79fdf189f36acaaee3d19483e1"
sha256 big_sur: "87f6eb467cf829fc4bbcacf6c3ff01302d29368005d9223b32392a590a4662d9"
sha256 catalina: "a378621dc5c0f6f70a7f09ce3f4d8fcbd5d3af34e3142c87470527d34b7e89ab"
sha256 x86_64_linux: "9655b45d88028baba031cd33618123625c3257a1cc1a710373636f1c2a06a26a"
end
head do
url "https://gitlab.com/muttmua/mutt.git"
resource "html" do
url "https://muttmua.gitlab.io/mutt/manual-dev.html"
end
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gpgme"
depends_on "openssl@1.1"
depends_on "tokyo-cabinet"
uses_from_macos "bzip2"
uses_from_macos "cyrus-sasl"
uses_from_macos "krb5"
uses_from_macos "ncurses"
uses_from_macos "zlib"
conflicts_with "tin", because: "both install mmdf.5 and mbox.5 man pages"
def install
user_in_mail_group = Etc.getgrnam("mail").mem.include?(ENV["USER"])
effective_group = Etc.getgrgid(Process.egid).name
args = %W[
--disable-dependency-tracking
--disable-warnings
--prefix=#{prefix}
--enable-debug
--enable-hcache
--enable-imap
--enable-pop
--enable-sidebar
--enable-smtp
--with-gss
--with-sasl
--with-ssl=#{Formula["openssl@1.1"].opt_prefix}
--with-tokyocabinet
--enable-gpgme
]
system "./prepare", *args
system "make"
# This permits the `mutt_dotlock` file to be installed under a group
# that isn't `mail`.
# https://github.com/Homebrew/homebrew/issues/45400
inreplace "Makefile", /^DOTLOCK_GROUP =.*$/, "DOTLOCK_GROUP = #{effective_group}" unless user_in_mail_group
system "make", "install"
doc.install resource("html") if build.head?
end
def caveats
<<~EOS
mutt_dotlock(1) has been installed, but does not have the permissions to lock
spool files in /var/mail. To grant the necessary permissions, run
sudo chgrp mail #{bin}/mutt_dotlock
sudo chmod g+s #{bin}/mutt_dotlock
Alternatively, you may configure `spoolfile` in your .muttrc to a file inside
your home directory.
EOS
end
test do
system bin/"mutt", "-D"
touch "foo"
system bin/"mutt_dotlock", "foo"
system bin/"mutt_dotlock", "-u", "foo"
end
end