# Note that odd release numbers indicate unstable releases. # Please only submit PRs for [x.x.even] version numbers: # https://github.com/djcb/mu/commit/23f4a64bdcdee3f9956a39b9a5a4fd0c5c2370ba class Mu < Formula desc "Tool for searching e-mail messages stored in the maildir-format" homepage "https://www.djcbsoftware.nl/code/mu/" url "https://github.com/djcb/mu/releases/download/v1.0/mu-1.0.tar.xz" sha256 "966adc4db108f8ddf162891f9c3c24ba27f78c31f86575a0e05fbf14e857a513" revision 1 bottle do cellar :any sha256 "0e4a61daf8d93a9aa866da1891d69f34024344910c98b3efae13f83fd850cb2f" => :mojave sha256 "8ee77a30b4b54367394b3a37b419d3d183950762728b118154e0bacf91e4f059" => :high_sierra sha256 "d6ecd32c774b34ab93ac9aefd16d8a703976a3bee23b581f803153b19f42772e" => :sierra end head do url "https://github.com/djcb/mu.git" depends_on "autoconf-archive" => :build end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libgpg-error" => :build depends_on "libtool" => :build depends_on "pkg-config" => :build depends_on "emacs" depends_on "gettext" depends_on "glib" depends_on "xapian" # Currently requires gmime 2.6.x resource "gmime" do url "https://download.gnome.org/sources/gmime/2.6/gmime-2.6.23.tar.xz" sha256 "7149686a71ca42a1390869b6074815106b061aaeaaa8f2ef8c12c191d9a79f6a" end def install resource("gmime").stage do system "./configure", "--prefix=#{prefix}/gmime", "--disable-introspection" system "make", "install" ENV.append_path "PKG_CONFIG_PATH", "#{prefix}/gmime/lib/pkgconfig" end system "autoreconf", "-ivf" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-lispdir=#{elisp}" system "make" system "make", "install" end def caveats; <<~EOS Existing mu users are recommended to run the following after upgrading: mu index --rebuild EOS end # Regression test for: # https://github.com/djcb/mu/issues/397 # https://github.com/djcb/mu/issues/380 # https://github.com/djcb/mu/issues/332 test do mkdir (testpath/"cur") (testpath/"cur/1234567890.11111_1.host1!2,S").write <<~EOS From: "Road Runner" To: "Wile E. Coyote" Date: Mon, 4 Aug 2008 11:40:49 +0200 Message-id: <1111111111@example.com> Beep beep! EOS (testpath/"cur/0987654321.22222_2.host2!2,S").write <<~EOS From: "Wile E. Coyote" To: "Road Runner" Date: Mon, 4 Aug 2008 12:40:49 +0200 Message-id: <2222222222@example.com> References: <1111111111@example.com> This used to happen outdoors. It was more fun then. EOS system "#{bin}/mu", "index", "--muhome", testpath, "--maildir=#{testpath}" mu_find = "#{bin}/mu find --muhome #{testpath} " find_message = "#{mu_find} msgid:2222222222@example.com" find_message_and_related = "#{mu_find} --include-related msgid:2222222222@example.com" assert_equal 1, shell_output(find_message).lines.count assert_equal 2, shell_output(find_message_and_related).lines.count, "You tripped over https://github.com/djcb/mu/issues/380\n\t--related doesn't work. Everything else should" end end