-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
/
notmuch.rb
97 lines (82 loc) · 3.38 KB
/
notmuch.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class Notmuch < Formula
include Language::Python::Shebang
desc "Thread-based email index, search, and tagging"
homepage "https://notmuchmail.org/"
url "https://notmuchmail.org/releases/notmuch-0.38.3.tar.xz"
sha256 "9af46cc80da58b4301ca2baefcc25a40d112d0315507e632c0f3f0f08328d054"
license "GPL-3.0-or-later"
revision 2
head "https://git.notmuchmail.org/git/notmuch", using: :git, branch: "master"
livecheck do
url "https://notmuchmail.org/releases/"
regex(/href=.*?notmuch[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_sequoia: "0cb5a27f8898383b7c6b5696d605b47466ae80ae73feabf7cc616935dba75571"
sha256 cellar: :any, arm64_sonoma: "77f11fdb21b081f7cdf38f0334efd97bf7f208d557278f3391947dd99c4819c6"
sha256 cellar: :any, arm64_ventura: "7f655d574419dbbe31f22724515dc695e062f2c9020d60dc6069657ec427907e"
sha256 cellar: :any, sonoma: "7873f14945e4cabf41579162fa9fa4beea2c00ef315002166f3c26f85432578c"
sha256 cellar: :any, ventura: "628cd7d9c59e86410c0d82c47f7c13f0aea37c210c0850eced14e2bf117ab96f"
sha256 cellar: :any_skip_relocation, x86_64_linux: "39562c54f856e2ce82c611ac9fce4d9656c55dc89262091bc047182c3e7338c8"
end
depends_on "doxygen" => :build
depends_on "emacs" => :build
depends_on "libgpg-error" => :build
depends_on "pkgconf" => :build
depends_on "sphinx-doc" => :build
depends_on "cffi"
depends_on "glib"
depends_on "gmime"
depends_on "python@3.13"
depends_on "sfsexp"
depends_on "talloc"
depends_on "xapian"
uses_from_macos "zlib", since: :sierra
on_macos do
depends_on "gettext"
end
def python3
"python3.13"
end
def install
ENV.cxx11 if OS.linux?
site_packages = Language::Python.site_packages(python3)
with_env(PYTHONPATH: Formula["sphinx-doc"].opt_libexec/site_packages) do
system "./configure", "--prefix=#{prefix}",
"--mandir=#{man}",
"--emacslispdir=#{elisp}",
"--emacsetcdir=#{elisp}",
"--bashcompletiondir=#{bash_completion}",
"--zshcompletiondir=#{zsh_completion}",
"--without-ruby"
system "make", "V=1", "install"
end
bin.install "notmuch-git"
rewrite_shebang detected_python_shebang, bin/"notmuch-git"
elisp.install Pathname.glob("emacs/*.el")
bash_completion.install "completion/notmuch-completion.bash"
(prefix/"vim/plugin").install "vim/notmuch.vim"
(prefix/"vim/doc").install "vim/notmuch.txt"
(prefix/"vim").install "vim/syntax"
["python", "python-cffi"].each do |subdir|
system python3, "-m", "pip", "install", *std_pip_args(build_isolation: true), "./bindings/#{subdir}"
end
end
test do
(testpath/".notmuch-config").write <<~INI
[database]
path=#{testpath}/Mail
INI
(testpath/"Mail").mkpath
assert_match "0 total", shell_output("#{bin}/notmuch new")
system python3, "-c", "import notmuch"
system python3, "-c", <<~PYTHON
import notmuch2
db = notmuch2.Database(mode=notmuch2.Database.MODE.READ_ONLY)
assert str(db.path) == '#{testpath}/Mail', 'Wrong db.path!'
db.close()
PYTHON
system bin/"notmuch-git", "-C", "#{testpath}/git", "init"
assert_predicate testpath/"git", :exist?
end
end