notmuch-addrlookup: 7 -> 9

This version bump contains the following fixes:

v8:
- Avoid a segmentation fault when notmuch_message_get_header() returns NULL. (Patch by Víctor M. Jáquez <vjaquez@igalia.com>).

v9:
- Do not use the deprecated notmuch_query_count_messages_st function when using Notmuch 0.25. (Patch by Adam Ruzicka <a.ruzicka@outlook.com>.)
We already had this patch in our tree.
- Fix crash in when running queries and the program is build with Notmuch 0.25. (Patch by Joshua Krusell <joshua.krusell@v-dem.net>).
- Fix conditional compilation when using Notmuch 0.25. (Patch by David Bremner <bremner@debian.org>).

+6 -54
-44
pkgs/applications/networking/mailreaders/notmuch-addrlookup/0001-notmuch-0.25-compatibility-fix.patch
··· 1 - From a736c0dfd22cd4ab0da86c30a664c91843df1b98 Mon Sep 17 00:00:00 2001 2 - From: Adam Ruzicka <a.ruzicka@outlook.com> 3 - Date: Sat, 29 Jul 2017 12:16:29 +0200 4 - Subject: [PATCH] notmuch-0.25 compatibility fix 5 - 6 - --- 7 - notmuch-addrlookup.c | 14 ++++++++++++++ 8 - 1 file changed, 14 insertions(+) 9 - 10 - diff --git a/notmuch-addrlookup.c b/notmuch-addrlookup.c 11 - index c5cf5b4..a95ded0 100644 12 - --- a/notmuch-addrlookup.c 13 - +++ b/notmuch-addrlookup.c 14 - @@ -171,6 +171,13 @@ create_queries (notmuch_database_t *db, 15 - count += tmp; 16 - if (notmuch_query_count_messages_st (queries[1], &tmp) == NOTMUCH_STATUS_SUCCESS) 17 - count += tmp; 18 - +#elif LIBNOTMUCH_MAJOR_VERSION >= 5 19 - + unsigned int count = 0; 20 - + unsigned int tmp; 21 - + if (notmuch_query_count_messages (queries[0], &tmp) == NOTMUCH_STATUS_SUCCESS) 22 - + count += tmp; 23 - + if (notmuch_query_count_messages (queries[1], &tmp) == NOTMUCH_STATUS_SUCCESS) 24 - + count += tmp; 25 - #else 26 - unsigned int count = notmuch_query_count_messages (queries[0]) 27 - + notmuch_query_count_messages (queries[1]); 28 - @@ -233,6 +240,13 @@ run_queries (notmuch_database_t *db, 29 - #if LIBNOTMUCH_MAJOR_VERSION >= 4 && LIBNOTMUCH_MINOR_VERSION >= 3 30 - if (notmuch_query_search_messages_st (queries[i], &messages) != NOTMUCH_STATUS_SUCCESS) 31 - continue; 32 - +#elif LIBNOTMUCH_MAJOR_VERSION >= 5 33 - + unsigned int count = 0; 34 - + unsigned int tmp; 35 - + if (notmuch_query_count_messages (queries[0], &tmp) == NOTMUCH_STATUS_SUCCESS) 36 - + count += tmp; 37 - + if (notmuch_query_count_messages (queries[1], &tmp) == NOTMUCH_STATUS_SUCCESS) 38 - + count += tmp; 39 - #else 40 - if (!(messages = notmuch_query_search_messages (queries[i]))) 41 - continue; 42 - -- 43 - 2.13.3 44 -
+6 -10
pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix
··· 1 1 { stdenv, fetchFromGitHub, pkgconfig, glib, notmuch }: 2 2 3 + let 4 + version = "9"; 5 + in 3 6 stdenv.mkDerivation rec { 4 7 name = "notmuch-addrlookup-${version}"; 5 - version = "7"; 6 8 7 9 src = fetchFromGitHub { 8 10 owner = "aperezdc"; 9 11 repo = "notmuch-addrlookup-c"; 10 12 rev ="v${version}"; 11 - sha256 = "0mz0llf1ggl1k46brgrqj3i8qlg1ycmkc5a3a0kg8fg4s1c1m6xk"; 13 + sha256 = "1j3zdx161i1x4w0nic14ix5i8hd501rb31daf8api0k8855sx4rc"; 12 14 }; 13 15 14 16 nativeBuildInputs = [ pkgconfig ]; 15 17 buildInputs = [ glib notmuch ]; 16 18 17 - # Required until notmuch-addrlookup can be compiled against notmuch >= 0.25 18 - patches = [ ./0001-notmuch-0.25-compatibility-fix.patch ]; 19 - 20 - installPhase = '' 21 - mkdir -p "$out/bin" 22 - cp notmuch-addrlookup "$out/bin" 23 - ''; 19 + installPhase = "install -D notmuch-addrlookup $out/bin/notmuch-addrlookup"; 24 20 25 21 meta = with stdenv.lib; { 26 22 description = "Address lookup tool for Notmuch in C"; 27 23 homepage = https://github.com/aperezdc/notmuch-addrlookup-c; 28 24 maintainers = with maintainers; [ mog garbas ]; 29 - platforms = platforms.linux; 25 + platforms = platforms.unix; 30 26 license = licenses.mit; 31 27 }; 32 28 }