102 lines
3.6 KiB
Ruby
102 lines
3.6 KiB
Ruby
# NOTE: Odd release numbers indicate unstable releases.
|
|
# Please only submit PRs for [x.even.x] 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/1.6.6/mu-1.6.6.tar.xz"
|
|
sha256 "42cd3d20f2a670fe57bedcde049b6b2b030fe51c507fdfdfeb6aa865f1f443b5"
|
|
license "GPL-3.0-or-later"
|
|
|
|
# We restrict matching to versions with an even-numbered minor version number,
|
|
# as an odd-numbered minor version number indicates a development version:
|
|
# https://github.com/djcb/mu/commit/23f4a64bdcdee3f9956a39b9a5a4fd0c5c2370ba
|
|
livecheck do
|
|
url :stable
|
|
regex(/^v?(\d+\.\d*[02468](?:\.\d+)*)$/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_big_sur: "3e8e35eb6318b5ed58556f9ac0c4fa25c808c9a264c00b14d71390f34c983381"
|
|
sha256 cellar: :any, big_sur: "29f19a1002c14ad90add4cac9a68b3144fab66db2ed5909ee6cd45984a9b4147"
|
|
sha256 cellar: :any, catalina: "10c340b63a84e07431cdeea94682bfd41920a667abf2657cc21c495ca022fcda"
|
|
sha256 cellar: :any, mojave: "f3fbce2bc43a6bc45bd2ca9d5ef2ad4a16bea47e80a0ffc42349ff3ec56f8ded"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "1f42f127087629f91b9591530523b3a52172839282c36135c8d5a8933c25945a"
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/djcb/mu.git"
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "autoconf-archive" => :build
|
|
depends_on "automake" => :build
|
|
end
|
|
|
|
depends_on "emacs" => :build
|
|
depends_on "libgpg-error" => :build
|
|
depends_on "libtool" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "gettext"
|
|
depends_on "glib"
|
|
depends_on "gmime"
|
|
depends_on "xapian"
|
|
|
|
uses_from_macos "texinfo" => :build
|
|
|
|
on_linux do
|
|
depends_on "gcc"
|
|
end
|
|
|
|
fails_with gcc: "5"
|
|
|
|
def install
|
|
system "autoreconf", "-ivf" if build.head?
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--disable-guile",
|
|
"--prefix=#{prefix}",
|
|
"--with-lispdir=#{elisp}"
|
|
system "make"
|
|
system "make", "install"
|
|
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" <fasterthanyou@example.com>
|
|
To: "Wile E. Coyote" <wile@example.com>
|
|
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" <wile@example.com>
|
|
To: "Road Runner" <fasterthanyou@example.com>
|
|
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", "init", "--muhome=#{testpath}", "--maildir=#{testpath}"
|
|
system "#{bin}/mu", "index", "--muhome=#{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, <<~EOS
|
|
You tripped over https://github.com/djcb/mu/issues/380
|
|
--related doesn't work. Everything else should
|
|
EOS
|
|
end
|
|
end
|