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.8/mu-1.6.8.tar.xz"
|
|
sha256 "d175272bec399c956393c8e2afa5e16f503b65417edc7e3224b50edd6d1f9750"
|
|
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: "abbbacf5eb2983c03fc209bd497bb828cf0c0077f0e1ec2d02710e86145db41a"
|
|
sha256 cellar: :any, big_sur: "3babbb7a81106cce91530c94be1e66f7184a65e67119d06d14e1641146487eea"
|
|
sha256 cellar: :any, catalina: "fb0ee00fbe19850a2edf6f88514a7179392f674fff26246a067ea60d2e570626"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "db2624e44332ca7e4a4916786db3129394f21f963f10e7b1c4320df4b6f3a21a"
|
|
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
|