summary refs log tree commit diff
path: root/pkgs/applications/networking/mailreaders/notmuch-addrlookup
diff options
context:
space:
mode:
authorAdam Růžička <adamruzicka@users.noreply.github.com>2017-08-30 18:43:27 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2017-08-30 18:43:27 +0200
commit55a123a49db4371b9108e35b675a6924df76a04f (patch)
tree2fe68b9c95cccc9d7d4cd5fc4c9dbcc98318aa39 /pkgs/applications/networking/mailreaders/notmuch-addrlookup
parent3d107c15bd0c9f32cd8e51ed5c4aa40e4b1accf8 (diff)
notmuch-addrlookup: fix build with notmuch 0.25 (#27691)
Diffstat (limited to 'pkgs/applications/networking/mailreaders/notmuch-addrlookup')
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch-addrlookup/0001-notmuch-0.25-compatibility-fix.patch44
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix3
2 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/applications/networking/mailreaders/notmuch-addrlookup/0001-notmuch-0.25-compatibility-fix.patch b/pkgs/applications/networking/mailreaders/notmuch-addrlookup/0001-notmuch-0.25-compatibility-fix.patch
new file mode 100644
index 0000000000000..be094c9a397f6
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/notmuch-addrlookup/0001-notmuch-0.25-compatibility-fix.patch
@@ -0,0 +1,44 @@
+From a736c0dfd22cd4ab0da86c30a664c91843df1b98 Mon Sep 17 00:00:00 2001
+From: Adam Ruzicka <a.ruzicka@outlook.com>
+Date: Sat, 29 Jul 2017 12:16:29 +0200
+Subject: [PATCH] notmuch-0.25 compatibility fix
+
+---
+ notmuch-addrlookup.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/notmuch-addrlookup.c b/notmuch-addrlookup.c
+index c5cf5b4..a95ded0 100644
+--- a/notmuch-addrlookup.c
++++ b/notmuch-addrlookup.c
+@@ -171,6 +171,13 @@ create_queries (notmuch_database_t *db,
+       count += tmp;
+   if (notmuch_query_count_messages_st (queries[1], &tmp) == NOTMUCH_STATUS_SUCCESS)
+       count += tmp;
++#elif LIBNOTMUCH_MAJOR_VERSION >= 5
++  unsigned int count = 0;
++  unsigned int tmp;
++  if (notmuch_query_count_messages (queries[0], &tmp) == NOTMUCH_STATUS_SUCCESS)
++      count += tmp;
++  if (notmuch_query_count_messages (queries[1], &tmp) == NOTMUCH_STATUS_SUCCESS)
++      count += tmp;
+ #else
+   unsigned int count = notmuch_query_count_messages (queries[0])
+                      + notmuch_query_count_messages (queries[1]);
+@@ -233,6 +240,13 @@ run_queries (notmuch_database_t *db,
+ #if LIBNOTMUCH_MAJOR_VERSION >= 4 && LIBNOTMUCH_MINOR_VERSION >= 3
+       if (notmuch_query_search_messages_st (queries[i], &messages) != NOTMUCH_STATUS_SUCCESS)
+           continue;
++#elif LIBNOTMUCH_MAJOR_VERSION >= 5
++  unsigned int count = 0;
++  unsigned int tmp;
++  if (notmuch_query_count_messages (queries[0], &tmp) == NOTMUCH_STATUS_SUCCESS)
++      count += tmp;
++  if (notmuch_query_count_messages (queries[1], &tmp) == NOTMUCH_STATUS_SUCCESS)
++      count += tmp;
+ #else
+       if (!(messages = notmuch_query_search_messages (queries[i])))
+           continue;
+--
+2.13.3
+
diff --git a/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix b/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix
index 2cc4905e43518..ae6033556faf8 100644
--- a/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix
@@ -13,6 +13,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pkgconfig glib notmuch ];
 
+  # Required until notmuch-addrlookup can be compiled against notmuch >= 0.25
+  patches = [ ./0001-notmuch-0.25-compatibility-fix.patch ];
+
   installPhase = ''
     mkdir -p "$out/bin"
     cp notmuch-addrlookup "$out/bin"