From 5fe1e98e3a2e3af9139bbb81953a4dd6bdfbd1eb Mon Sep 17 00:00:00 2001 From: Danie Roux Date: Sat, 21 Feb 2015 20:18:33 +0200 Subject: [PATCH] mu: fix --include-related option for 10.9 - Compile with -O0 on >= mavericks - Add a test for mu - https://github.com/djcb/mu/issues/380 - Remove MACOSX_DEPLOYMENT_TARGET hack https://github.com/djcb/mu/issues/332 is the same root cause as https://github.com/djcb/mu/issues/380 which is fixed by https://github.com/Homebrew/homebrew/pull/37020 Closes Homebrew/homebrew#37020. Signed-off-by: Mike McQuaid --- Formula/mu.rb | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/Formula/mu.rb b/Formula/mu.rb index 0471fb6560..b086bb9851 100644 --- a/Formula/mu.rb +++ b/Formula/mu.rb @@ -43,17 +43,15 @@ class Mu < Formula # shipped by default with Mac OS X is too old. ENV["EMACS"] = "no" if build.without? "emacs" - # I dunno. + # https://github.com/djcb/mu/issues/380 # https://github.com/djcb/mu/issues/332 - # https://github.com/Homebrew/homebrew/issues/25524 - ENV.delete "MACOSX_DEPLOYMENT_TARGET" + ENV.O0 if MacOS.version >= :mavericks && ENV.compiler == :clang system "autoreconf", "-ivf" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-gui=none" system "make" - system "make test" system "make install" end @@ -63,4 +61,40 @@ class Mu < Formula mu index --rebuild EOS end + + test do + mkdir (testpath/"cur") + + (testpath/"cur/1234567890.11111_1.host1!2,S").write <<-EOS.undent + 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.undent + 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