101 lines
3.5 KiB
Ruby
101 lines
3.5 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.10/mu-1.6.10.tar.xz"
|
|
sha256 "0bc224aab2bfe40b5209af14e0982e637789292b7979872658d4498b29e900b6"
|
|
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: "073b588a7ebfe1c9139994ac3e1f775b8c3106a41625b9c5c7f0019b9d3a6524"
|
|
sha256 cellar: :any, big_sur: "984ff5adf341446c8d7741d1413d6943e3ddf6cff86165a9af402f5c1f639bb6"
|
|
sha256 cellar: :any, catalina: "0299242cd384e4cc8fe2ae4397c8778572fd01e726bf0fe46a756e098ee98343"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "ec71ae61fccf1d797994a23bb4db6fa2c28ba11fd1000bcbcc5777f1dd7ca5f2"
|
|
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
|