all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: guix-devel@gnu.org
Cc: Marius Bakke <mbakke@fastmail.com>
Subject: [PATCH 2/4] gnu: notmuch: Enable tests.
Date: Mon, 17 Oct 2016 17:55:04 +0100	[thread overview]
Message-ID: <20161017165506.17750-3-mbakke@fastmail.com> (raw)
In-Reply-To: <20161017165506.17750-1-mbakke@fastmail.com>

* gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/mail.scm (notmuch)[arguments]: Add verbose make flags.
  Add phase 'patch-notmuch-lib.el' to fix hard-coded /bin/sh.
  Add 'prepare-test-environment' phase to patch test shebangs and set
  environment.
[native-inputs]: Change from 'emacs-minimal' to 'emacs-no-x'. Add dtach,
  gnupg, man, perl and which.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/mail.scm                              | 36 +++++++++++++++---
 .../notmuch-emacs-25-compatibility-fix.patch       | 43 ++++++++++++++++++++++
 3 files changed, 74 insertions(+), 6 deletions(-)
 create mode 100644 gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 9079b42..9d7e14b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -728,6 +728,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ninja-tests.patch			\
   %D%/packages/patches/ninja-zero-mtime.patch			\
   %D%/packages/patches/node-9077.patch				\
+  %D%/packages/patches/notmuch-emacs-25-compatibility-fix.patch	\
   %D%/packages/patches/nss-pkgconfig.patch			\
   %D%/packages/patches/nvi-assume-preserve-path.patch		\
   %D%/packages/patches/nvi-dbpagesize-binpower.patch		\
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 1cb3ef4..6ab4035 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -72,7 +72,9 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gdb)
+  #:use-module (gnu packages man)
   #:use-module (gnu packages samba)
+  #:use-module (gnu packages screen)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages web)
@@ -501,12 +503,20 @@ invoking @command{notifymuch} from the post-new hook.")
                                   version ".tar.gz"))
               (sha256
                (base32
-                "1f51l34rdhjf8lvafrwybkxdsdwx8k9397m7qxd8rdg2irjmpry5"))))
+                "1f51l34rdhjf8lvafrwybkxdsdwx8k9397m7qxd8rdg2irjmpry5"))
+              (patches
+               ;; This is included in the next release.
+               ;; https://notmuchmail.org/pipermail/notmuch/2016/023309.html
+               (search-patches "notmuch-emacs-25-compatibility-fix.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:tests? #f ; FIXME: 723 tests; 187 fail and 100 are skipped
-                   ; with perl input: 67 fail and 100 are skipped
+     '(#:make-flags (list "V=1") ; Verbose test output.
        #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'patch-notmuch-lib.el
+                    (lambda _
+                      (substitute* "emacs/notmuch-lib.el"
+                        (("/bin/sh") (which "sh")))
+                      #t))
                   (replace 'configure
                     (lambda* (#:key outputs #:allow-other-keys)
                       (setenv "CC" "gcc")
@@ -514,14 +524,28 @@ invoking @command{notifymuch} from the post-new hook.")
 
                       (let ((out (assoc-ref outputs "out")))
                         (zero? (system* "./configure"
-                                        (string-append "--prefix=" out)))))))))
+                                        (string-append "--prefix=" out))))))
+                  (add-before 'check 'prepare-test-environment
+                    (lambda _
+                      (setenv "TEST_CC" "gcc")
+                      ;; Patch various inline shell invocations.
+                      (substitute* (find-files "test" "\\.sh$")
+                        (("/bin/sh") (which "sh")))
+                      #t)))))
     (native-inputs
      `(("bash-completion" ,bash-completion)
-       ("emacs" ,emacs-minimal)
+       ("emacs" ,emacs-no-x) ; Minimal lacks libxml, needed for some tests.
        ("pkg-config" ,pkg-config)
        ("python" ,python-2)
        ("python-docutils" ,python2-docutils)
-       ("python-sphinx" ,python2-sphinx)))
+       ("python-sphinx" ,python2-sphinx)
+
+       ;; The following are required for tests only.
+       ("which" ,which)
+       ("dtach" ,dtach)
+       ("gnupg" ,gnupg)
+       ("man" ,man-db)
+       ("perl" ,perl)))
     (inputs
      `(("glib" ,glib)
        ("gmime" ,gmime)
diff --git a/gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch b/gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch
new file mode 100644
index 0000000..456b345
--- /dev/null
+++ b/gnu/packages/patches/notmuch-emacs-25-compatibility-fix.patch
@@ -0,0 +1,43 @@
+From f575a346df09c82691bb9e7c462836d982fe31f7 Mon Sep 17 00:00:00 2001
+From: David Bremner <david@tethera.net>
+Date: Sun, 9 Oct 2016 19:30:44 -0300
+Subject: [PATCH] emacs/show: force notmuch-show-buttonise-links to act on
+ lines
+
+This seems to fix a problem with emacs 25 creating partial buttons by
+calling n-s-b-l with a region that does not include the whole button.
+I'm not 100% sure it's legit to act outside the region passed by
+jit-lock, but goto-address-fontify-region (where I borrowed the code
+from) already does this, so this patch to not make things worse.
+---
+ emacs/notmuch-show.el | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
+index 641398d..e7d16f8 100644
+--- a/emacs/notmuch-show.el
++++ b/emacs/notmuch-show.el
+@@ -1174,13 +1174,15 @@ This also turns id:\"<message id>\"-parts and mid: links into
+ buttons for a corresponding notmuch search."
+   (goto-address-fontify-region start end)
+   (save-excursion
+-    (let (links)
+-      (goto-char start)
+-      (while (re-search-forward notmuch-id-regexp end t)
++    (let (links
++	  (beg-line (progn (goto-char start) (line-beginning-position)))
++	  (end-line (progn (goto-char end) (line-end-position))))
++      (goto-char beg-line)
++      (while (re-search-forward notmuch-id-regexp end-line t)
+ 	(push (list (match-beginning 0) (match-end 0)
+ 		    (match-string-no-properties 0)) links))
+-      (goto-char start)
+-      (while (re-search-forward notmuch-mid-regexp end t)
++      (goto-char beg-line)
++      (while (re-search-forward notmuch-mid-regexp end-line t)
+ 	(let* ((mid-cid (match-string-no-properties 1))
+ 	       (mid (save-match-data
+ 		      (string-match "^[^/]*" mid-cid)
+-- 
+2.10.1
+
-- 
2.10.1

  parent reply	other threads:[~2016-10-17 16:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 16:55 [PATCH 0/4] Notmuch and Xapian update Marius Bakke
2016-10-17 16:55 ` [PATCH 1/4] gnu: notmuch: Update to 0.23 Marius Bakke
2016-10-17 17:58   ` Leo Famulari
2016-10-17 18:43     ` Marius Bakke
2016-10-17 16:55 ` Marius Bakke [this message]
2016-10-17 18:29   ` [PATCH 2/4] gnu: notmuch: Enable tests Leo Famulari
2016-10-17 18:56     ` Marius Bakke
2016-10-17 16:55 ` [PATCH 3/4] gnu: xapian: Use 'modify-phases' Marius Bakke
2016-10-17 18:00   ` Leo Famulari
2016-10-17 18:50     ` Marius Bakke
2016-10-17 16:55 ` [PATCH 4/4] gnu: xapian: Update to 1.4.0 Marius Bakke
2016-10-17 19:49   ` Leo Famulari
2016-10-18 21:55     ` Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161017165506.17750-3-mbakke@fastmail.com \
    --to=mbakke@fastmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.