Gentoo Archives: gentoo-commits

From: "Amadeusz Piotr Żołnowski" <aidecoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-mail/notmuch/, net-mail/notmuch/files/
Date: Sat, 15 Oct 2016 19:34:42
Message-Id: 1476559128.926540f8775a045100134ac33a5af23752551964.aidecoe@gentoo
1 commit: 926540f8775a045100134ac33a5af23752551964
2 Author: Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 15 19:18:32 2016 +0000
4 Commit: Amadeusz Piotr Żołnowski <aidecoe <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 15 19:18:48 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=926540f8
7
8 net-mail/notmuch: Backport fixes to 0.23
9
10 Fix Emacs 25.1 compatibility issue. Restore colours for unread and
11 flagged tags accidentally swapped in 0.23.
12
13 Package-Manager: portage-2.3.2
14
15 .../files/0.23-0001-emacs-id-buttonization.patch | 43 +++++
16 .../files/0.23-0002-emacs-search-face-bugfix.patch | 36 ++++
17 net-mail/notmuch/notmuch-0.23-r1.ebuild | 204 +++++++++++++++++++++
18 3 files changed, 283 insertions(+)
19
20 diff --git a/net-mail/notmuch/files/0.23-0001-emacs-id-buttonization.patch b/net-mail/notmuch/files/0.23-0001-emacs-id-buttonization.patch
21 new file mode 100644
22 index 00000000..0c05373
23 --- /dev/null
24 +++ b/net-mail/notmuch/files/0.23-0001-emacs-id-buttonization.patch
25 @@ -0,0 +1,43 @@
26 +From b913a28f65e32380a84da735e0524f8d5c127f93 Mon Sep 17 00:00:00 2001
27 +From: David Bremner <david@×××××××.net>
28 +Date: Sun, 9 Oct 2016 19:30:44 -0300
29 +Subject: [PATCH 1/3] emacs/show: force notmuch-show-buttonise-links to act on
30 + lines
31 +
32 +This seems to fix a problem with emacs 25 creating partial buttons by
33 +calling n-s-b-l with a region that does not include the whole button.
34 +I'm not 100% sure it's legit to act outside the region passed by
35 +jit-lock, but goto-address-fontify-region (where I borrowed the code
36 +from) already does this, so this patch to not make things worse.
37 +---
38 + emacs/notmuch-show.el | 12 +++++++-----
39 + 1 file changed, 7 insertions(+), 5 deletions(-)
40 +
41 +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
42 +index 641398d..e7d16f8 100644
43 +--- a/emacs/notmuch-show.el
44 ++++ b/emacs/notmuch-show.el
45 +@@ -1174,13 +1174,15 @@ This also turns id:\"<message id>\"-parts and mid: links into
46 + buttons for a corresponding notmuch search."
47 + (goto-address-fontify-region start end)
48 + (save-excursion
49 +- (let (links)
50 +- (goto-char start)
51 +- (while (re-search-forward notmuch-id-regexp end t)
52 ++ (let (links
53 ++ (beg-line (progn (goto-char start) (line-beginning-position)))
54 ++ (end-line (progn (goto-char end) (line-end-position))))
55 ++ (goto-char beg-line)
56 ++ (while (re-search-forward notmuch-id-regexp end-line t)
57 + (push (list (match-beginning 0) (match-end 0)
58 + (match-string-no-properties 0)) links))
59 +- (goto-char start)
60 +- (while (re-search-forward notmuch-mid-regexp end t)
61 ++ (goto-char beg-line)
62 ++ (while (re-search-forward notmuch-mid-regexp end-line t)
63 + (let* ((mid-cid (match-string-no-properties 1))
64 + (mid (save-match-data
65 + (string-match "^[^/]*" mid-cid)
66 +--
67 +2.10.1
68 +
69
70 diff --git a/net-mail/notmuch/files/0.23-0002-emacs-search-face-bugfix.patch b/net-mail/notmuch/files/0.23-0002-emacs-search-face-bugfix.patch
71 new file mode 100644
72 index 00000000..39651cb
73 --- /dev/null
74 +++ b/net-mail/notmuch/files/0.23-0002-emacs-search-face-bugfix.patch
75 @@ -0,0 +1,36 @@
76 +From e64f1ec1db49406d4834b09d8c4b2aec83ba66cb Mon Sep 17 00:00:00 2001
77 +From: Mark Walters <markwalters1009@×××××.com>
78 +Date: Wed, 12 Oct 2016 08:39:21 +0100
79 +Subject: [PATCH 2/3] emacs: search face bugfix
80 +
81 +In commit 2a7b11b064233afc4feead876fa396e3c18a6b91 the default faces
82 +for unread and flagged were accidentally swapped. This swaps them back.
83 +---
84 + emacs/notmuch.el | 4 ++--
85 + 1 file changed, 2 insertions(+), 2 deletions(-)
86 +
87 +diff --git a/emacs/notmuch.el b/emacs/notmuch.el
88 +index 8e14692..48c33fd 100644
89 +--- a/emacs/notmuch.el
90 ++++ b/emacs/notmuch.el
91 +@@ -313,7 +313,7 @@ there will be called at other points of notmuch execution."
92 +
93 + (defface notmuch-search-flagged-face
94 + '((t
95 +- (:weight bold)))
96 ++ (:foreground "blue")))
97 + "Face used in search mode face for flagged threads.
98 +
99 + This face is the default value for the \"flagged\" tag in
100 +@@ -323,7 +323,7 @@ This face is the default value for the \"flagged\" tag in
101 +
102 + (defface notmuch-search-unread-face
103 + '((t
104 +- (:foreground "blue")))
105 ++ (:weight bold)))
106 + "Face used in search mode for unread threads.
107 +
108 + This face is the default value for the \"unread\" tag in
109 +--
110 +2.10.1
111 +
112
113 diff --git a/net-mail/notmuch/notmuch-0.23-r1.ebuild b/net-mail/notmuch/notmuch-0.23-r1.ebuild
114 new file mode 100644
115 index 00000000..2f4c8d4
116 --- /dev/null
117 +++ b/net-mail/notmuch/notmuch-0.23-r1.ebuild
118 @@ -0,0 +1,204 @@
119 +# Copyright 1999-2016 Gentoo Foundation
120 +# Distributed under the terms of the GNU General Public License v2
121 +# $Id$
122 +
123 +EAPI=6
124 +
125 +DISTUTILS_OPTIONAL=1
126 +PYTHON_COMPAT=( python{2_7,3_3,3_4} )
127 +
128 +inherit bash-completion-r1 elisp-common eutils flag-o-matic pax-utils \
129 + distutils-r1 toolchain-funcs
130 +
131 +DESCRIPTION="Thread-based e-mail indexer, supporting quick search and tagging"
132 +HOMEPAGE="http://notmuchmail.org/"
133 +SRC_URI="${HOMEPAGE%/}/releases/${P}.tar.gz
134 + test? ( ${HOMEPAGE%/}/releases/test-databases/database-v1.tar.xz )"
135 +
136 +LICENSE="GPL-3"
137 +# Sub-slot corresponds to major wersion of libnotmuch.so.X.Y. Bump of Y is
138 +# meant to be binary backward compatible.
139 +SLOT="0/4"
140 +KEYWORDS="~alpha ~amd64 ~x86"
141 +REQUIRED_USE="
142 + nmbug? ( python )
143 + python? ( ${PYTHON_REQUIRED_USE} )
144 + test? ( crypt emacs python valgrind )
145 + "
146 +IUSE="crypt doc emacs mutt nmbug python test valgrind"
147 +
148 +CDEPEND="
149 + >=app-shells/bash-completion-1.9
150 + >=dev-libs/glib-2.22:2
151 + >=dev-libs/gmime-2.6.20-r2:2.6
152 + >=dev-libs/xapian-1.2.7-r2:=
153 + dev-python/sphinx[${PYTHON_USEDEP}]
154 + >=sys-libs/zlib-1.2.5.2
155 + sys-libs/talloc
156 + crypt? ( >=dev-libs/gmime-2.6.20-r2:2.6[smime] )
157 + emacs? ( >=virtual/emacs-23 )
158 + python? ( ${PYTHON_DEPS} )
159 + "
160 +DEPEND="${CDEPEND}
161 + virtual/pkgconfig
162 + doc? ( app-doc/doxygen )
163 + test? ( app-misc/dtach || ( >=app-editors/emacs-23[libxml2]
164 + >=app-editors/emacs-vcs-23[libxml2] ) sys-devel/gdb
165 + crypt? ( app-crypt/gnupg dev-libs/openssl ) )
166 + valgrind? ( dev-util/valgrind )
167 + "
168 +RDEPEND="${CDEPEND}
169 + crypt? ( app-crypt/gnupg )
170 + nmbug? ( dev-vcs/git )
171 + mutt? ( dev-perl/File-Which dev-perl/Mail-Box dev-perl/MailTools
172 + dev-perl/String-ShellQuote dev-perl/Term-ReadLine-Gnu
173 + virtual/perl-Digest-SHA virtual/perl-File-Path virtual/perl-Getopt-Long
174 + virtual/perl-Pod-Parser )
175 + "
176 +
177 +DOCS=( AUTHORS NEWS README )
178 +PATCHES=(
179 + "${FILESDIR}/${PV}-0001-emacs-id-buttonization.patch"
180 + "${FILESDIR}/${PV}-0002-emacs-search-face-bugfix.patch"
181 + )
182 +SITEFILE="50${PN}-gentoo.el"
183 +MY_LD_LIBRARY_PATH="${WORKDIR}/${P}/lib"
184 +
185 +bindings() {
186 + local ret=0
187 +
188 + if use $1; then
189 + pushd bindings/$1 || die
190 + shift
191 + "$@"
192 + ret=$?
193 + popd || die
194 + fi
195 +
196 + return $ret
197 +}
198 +
199 +pkg_pretend() {
200 + if has_version '<net-mail/notmuch-0.18'; then
201 + ewarn
202 + ewarn "There are few not backward compatible changes between"
203 + ewarn "<notmuch-0.18 and >=notmuch-0.18. See NEWS file"
204 + ewarn "(0.18 section) for details before first use!"
205 + ewarn
206 + fi
207 +}
208 +
209 +pkg_setup() {
210 + if use emacs; then
211 + elisp-need-emacs 23 || die "Emacs version too low"
212 + fi
213 +}
214 +
215 +src_unpack() {
216 + unpack "${P}".tar.gz
217 + if use test; then
218 + mkdir -p "${S}"/test/test-databases || die
219 + cp "${DISTDIR}"/database-v1.tar.xz "${S}"/test/test-databases/ || die
220 + fi
221 +}
222 +
223 +src_prepare() {
224 + default
225 +
226 + bindings python distutils-r1_src_prepare
227 + bindings python mv README README-python || die
228 + mv contrib/notmuch-mutt/README contrib/notmuch-mutt/README-mutt || die
229 +
230 + rm -f Makefile.config # assure that new Makefile.config will be generated
231 +
232 + if use test; then
233 + append-cflags -g
234 + append-cxxflags -g
235 + fi
236 +}
237 +
238 +src_configure() {
239 + local myeconfargs=(
240 + --bashcompletiondir="$(get_bashcompdir)"
241 + --emacslispdir="${EPREFIX}/${SITELISP}/${PN}"
242 + --emacsetcdir="${EPREFIX}/${SITEETC}/${PN}"
243 + --without-ruby
244 + --zshcompletiondir="${EPREFIX}/usr/share/zsh/site-functions"
245 + $(use_with emacs)
246 + $(use_with doc api-docs)
247 + )
248 + tc-export CC CXX
249 + econf "${myeconfargs[@]}"
250 +}
251 +
252 +src_compile() {
253 + V=1 default
254 + bindings python distutils-r1_src_compile
255 +
256 + if use mutt; then
257 + pushd contrib/notmuch-mutt || die
258 + emake notmuch-mutt.1
259 + popd || die
260 + fi
261 +
262 + if use doc; then
263 + pydocs() {
264 + pushd docs || die
265 + emake html
266 + rm -r html/_sources || die
267 + rm html/{objects.inv,.buildinfo} || die
268 + mkdir -p ../html && mv html ../html/python || die
269 + popd || die
270 + }
271 + LD_LIBRARY_PATH="${MY_LD_LIBRARY_PATH}" bindings python pydocs
272 + fi
273 +}
274 +
275 +src_test() {
276 + pax-mark -m notmuch
277 + LD_LIBRARY_PATH="${MY_LD_LIBRARY_PATH}" V=1 default
278 + pax-mark -ze notmuch
279 +}
280 +
281 +src_install() {
282 + default
283 +
284 + if use emacs; then
285 + elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die
286 + fi
287 +
288 + if use nmbug; then
289 + dobin devel/nmbug/nmbug
290 + dobin devel/nmbug/notmuch-report
291 + fi
292 +
293 + if use mutt; then
294 + pushd contrib/notmuch-mutt || die
295 + dobin notmuch-mutt
296 + doman notmuch-mutt.1
297 + insinto /etc/mutt
298 + doins notmuch-mutt.rc
299 + dodoc README-mutt
300 + popd || die
301 + fi
302 +
303 + DOCS="" bindings python distutils-r1_src_install
304 + use doc && bindings python dodoc -r html
305 +}
306 +
307 +pkg_preinst() {
308 + if use mutt && ! [[ -e ${ROOT}/etc/mutt/notmuch-mutt.rc ]]; then
309 + elog "To enable notmuch support in mutt, add the following line into"
310 + elog "your mutt config file, please:"
311 + elog ""
312 + elog " source /etc/mutt/notmuch-mutt.rc"
313 + fi
314 +}
315 +
316 +pkg_postinst() {
317 + use emacs && elisp-site-regen
318 +}
319 +
320 +pkg_postrm() {
321 + use emacs && elisp-site-regen
322 +}