# 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, new patches are not being # accepted for this formula. We would be very happy to see members of # the mutt community maintain a more comprehesive tap with better # support for patches. 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.6.0.tar.gz" mirror "ftp://ftp.mutt.org/pub/mutt/mutt-1.6.0.tar.gz" sha256 "29afb6238ab7a540c0e3a78ce25c970f975ab6c0f0bc9f919993aab772136c19" bottle do revision 1 sha256 "06e06c5aa69200dc8070f870faf1267e94e93a06fbbe19c56809ad8c87338970" => :el_capitan sha256 "95765c32a076db6f7732217c1c667ca4d9a8157355f5c075b3912b6a2e7321f4" => :yosemite sha256 "81ff19dbdfa6ea08be29388cde8ebdff19b128b51d6557ea0e42e8afadb02350" => :mavericks end head do url "https://dev.mutt.org/hg/mutt#default", :using => :hg resource "html" do url "https://dev.mutt.org/doc/manual.html", :using => :nounzip end end conflicts_with "tin", :because => "both install mmdf.5 and mbox.5 man pages" option "with-debug", "Build with debug option enabled" option "with-s-lang", "Build against slang instead of ncurses" option "with-confirm-attachment-patch", "Apply confirm attachment patch" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "openssl" depends_on "tokyo-cabinet" depends_on "gettext" => :optional depends_on "gpgme" => :optional depends_on "libidn" => :optional depends_on "s-lang" => :optional if build.with? "confirm-attachment-patch" patch do url "https://gist.githubusercontent.com/tlvince/5741641/raw/c926ca307dc97727c2bd88a84dcb0d7ac3bb4bf5/mutt-attach.patch" sha256 "da2c9e54a5426019b84837faef18cc51e174108f07dc7ec15968ca732880cb14" end end def install user_admin = Etc.getgrnam("admin").mem.include?(ENV["USER"]) args = %W[ --disable-dependency-tracking --disable-warnings --prefix=#{prefix} --with-ssl=#{Formula["openssl"].opt_prefix} --with-sasl --with-gss --enable-imap --enable-smtp --enable-pop --enable-hcache --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 << "--disable-nls" if build.without? "gettext" args << "--enable-gpgme" if build.with? "gpgme" args << "--with-slang" if build.with? "s-lang" if build.with? "debug" args << "--enable-debug" else args << "--disable-debug" end 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