guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/38: gnu: dovecot-trees: Fix build with dovecot 2.3.


From: Tobias Geerinckx-Rice
Subject: 01/38: gnu: dovecot-trees: Fix build with dovecot 2.3.
Date: Mon, 25 Jun 2018 22:24:21 -0400 (EDT)

nckx pushed a commit to branch master
in repository guix.

commit 0e66f4a12f7a9f7a0840f1e072b21291c7b66596
Author: Tobias Geerinckx-Rice <address@hidden>
Date:   Mon Jun 25 00:37:53 2018 +0200

    gnu: dovecot-trees: Fix build with dovecot 2.3.
    
    * gnu/packages/mail.scm (dovecot-trees)[source]: Add patch.
    * gnu/packages/patches/dovecot-trees-support-dovecot-2.3.patch: New
    file.
    * gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/mail.scm                              |  4 +-
 .../dovecot-trees-support-dovecot-2.3.patch        | 60 ++++++++++++++++++++++
 3 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index d579841..9b832e3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -639,6 +639,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/docbook-xsl-nonrecursive-string-subst.patch     \
   %D%/packages/patches/doc++-include-directives.patch          \
   %D%/packages/patches/doc++-segfault-fix.patch                        \
+  %D%/packages/patches/dovecot-trees-support-dovecot-2.3.patch \
   %D%/packages/patches/doxygen-gcc-ice.patch                   \
   %D%/packages/patches/doxygen-test.patch                      \
   %D%/packages/patches/dvd+rw-tools-add-include.patch          \
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 57d5897..aa9042e 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1273,7 +1273,9 @@ It supports mbox/Maildir and its own dbox/mdbox formats.")
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "0rkk10b1bsjz979sc864vpgcdchy7yxwmyv4ik50lar1h6awdnrf"))))
+         "0rkk10b1bsjz979sc864vpgcdchy7yxwmyv4ik50lar1h6awdnrf"))
+       (patches
+        (search-patches "dovecot-trees-support-dovecot-2.3.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("automake" ,automake)
diff --git a/gnu/packages/patches/dovecot-trees-support-dovecot-2.3.patch 
b/gnu/packages/patches/dovecot-trees-support-dovecot-2.3.patch
new file mode 100644
index 0000000..314f6b6
--- /dev/null
+++ b/gnu/packages/patches/dovecot-trees-support-dovecot-2.3.patch
@@ -0,0 +1,60 @@
+From: Tobias Geerinckx-Rice <address@hidden>
+Date: Mon, 25 Jun 2018 00:34:52 +0200
+Subject: dovecot-trees: Fix build with dovecot 2.3.
+
+The following patch was taken verbatim from the upstream repository[0]
+and will be included in the next release.
+
+[0]: 
https://0xacab.org/riseuplabs/trees/commit/e136c32a044701d68b0235b8405357c5fca62a11
+---
+From e136c32a044701d68b0235b8405357c5fca62a11 Mon Sep 17 00:00:00 2001
+From: David Goulet <address@hidden>
+Date: Tue, 10 Apr 2018 13:48:01 -0400
+Subject: [PATCH] Support dovecot 2.3
+
+Untested but it builds now properly. Thanks to "smorks" for the report!
+
+Fixes #16
+
+Signed-off-by: David Goulet <address@hidden>
+---
+ src/trees-istream.c | 4 ++++
+ src/trees-ostream.c | 7 +++++++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/src/trees-istream.c b/src/trees-istream.c
+index b08ff16..e94be7d 100644
+--- a/src/trees-istream.c
++++ b/src/trees-istream.c
+@@ -431,5 +431,9 @@ trees_istream_create(struct istream *input,
+   sstream->out_byte_count = 0;
+ #endif
+ 
++#if DOVECOT_PREREQ(2, 3)
++      return i_stream_create(&sstream->istream, input, 
i_stream_get_fd(input), 0);
++#else
+   return i_stream_create(&sstream->istream, input, i_stream_get_fd(input));
++#endif /* DOVECOT_PREREQ */
+ }
+diff --git a/src/trees-ostream.c b/src/trees-ostream.c
+index 1b25a91..0cb7867 100644
+--- a/src/trees-ostream.c
++++ b/src/trees-ostream.c
+@@ -174,7 +174,14 @@ trees_ostream_sendv(struct ostream_private *stream,
+ static int
+ trees_ostream_flush(struct ostream_private *stream)
+ {
++  /* This is pretty ugly but unfortunately between 2.2 and 2.3, Dovecot 
changed
++   * the expected value to be non zero in 2.3+ . */
++#if DOVECOT_PREREQ(2, 3)
++  ssize_t result = 1;
++#else
+   ssize_t result = 0;
++#endif /* DOVECOT_PREREQ */
++
+   struct trees_ostream *sstream = (struct trees_ostream *) stream;
+ 
+   if (sstream->flushed) {
+-- 
+2.17.1
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]