102 lines
2.9 KiB
Ruby
102 lines
2.9 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-1.14.7.tar.gz"
|
|
sha256 "e4f507b133253cb5eef27996b8668956cdf9caac622cf8adad13f0f9a4eda864"
|
|
license "GPL-2.0-or-later"
|
|
|
|
livecheck do
|
|
url :stable
|
|
end
|
|
|
|
bottle do
|
|
rebuild 1
|
|
sha256 "e20f2379b28260a7cd995dfc019e82c4cb72ef1d5a2e15c93328088994d556b9" => :catalina
|
|
sha256 "592e488746c4b7ff7f6d4c814baa2f14528c2563364503a34ba100a0bf74a2f7" => :mojave
|
|
sha256 "8916a5de4c7c6734e3039f3e5f1e880fc9624bce8f27fe8e0ef2e25c51f120e7" => :high_sierra
|
|
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 "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
|