homebrew-core/Formula/mutt.rb
2018-12-07 15:58:22 +13:00

82 lines
2.5 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.11.1.tar.gz"
sha256 "705141013662e53b78e49ed545360281f30a09ddda908f4de733277a60b1db05"
bottle do
sha256 "cc81730a08426a73c58da6e76c91852eddc2a8a5eecfa48110959d7af0bb4ec7" => :mojave
sha256 "8d4627fa9074eb9d72f7653fd02d7c4c2f88a341955a3ce59437c4e3b93b11e4" => :high_sierra
sha256 "a608389b2a68f3e986e5487ad817e0b8688df96f02a799dd4440991eb20ca069" => :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 "openssl"
depends_on "tokyo-cabinet"
depends_on "gpgme" => :optional
conflicts_with "tin",
:because => "both install mmdf.5 and mbox.5 man pages"
def install
user_admin = Etc.getgrnam("admin").mem.include?(ENV["USER"])
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"].opt_prefix}
--with-tokyocabinet
]
# This is just a trick to keep 'make install' from trying
# to chgrp the mutt_dotlock file (which we can't do if
# we're running as an unprivileged user)
args << "--with-homespool=.mbox" unless user_admin
args << "--enable-gpgme" if build.with? "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
if user_admin
inreplace "Makefile", /^DOTLOCK_GROUP =.*$/, "DOTLOCK_GROUP = admin"
end
system "make", "install"
doc.install resource("html") if build.head?
end
test do
system bin/"mutt", "-D"
end
end