Re: [PATCH] cli/lib: remove support for GMime 2.4

2015-08-26 Thread David Bremner
David Bremner da...@tethera.net writes:

 It's becoming a maintenance burden to do anything things with the
 crypto glue code twice, once for 2.4 and once for 2.6. I don't have
 any 2.4 version available to test on my development machine anymore,
 so the 2.4 specific code paths are likely not very well tested.

I have pushed this change, along with a minimal note in NEWS

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] cli/lib: remove support for GMime 2.4

2015-08-17 Thread Tomi Ollila
On Mon, Aug 17 2015, Daniel Kahn Gillmor d...@fifthhorseman.net wrote:

 On Sun 2015-08-16 21:53:36 +0200, Tomi Ollila wrote:
 On Sun, Aug 16 2015, David Bremner da...@tethera.net wrote:

 It's becoming a maintenance burden to do anything things with the
 crypto glue code twice, once for 2.4 and once for 2.6. I don't have
 any 2.4 version available to test on my development machine anymore,
 so the 2.4 specific code paths are likely not very well tested.
 ---

 I started to rebase the SMIME signature verification patches and got
 aggravated at solving the same conflicts twice in every file.

 2.6.7 is from 2012, so that's a bit newer than some of our
 requirements, but I think not so bad. YMMV.

 Perhaps it is time for me to update to gmime 2.6 in this machine. PITA ;/

 Please do, i think gmime 2.4 is really not well-supported upstream any
 more either.

Hmm, it seems I've been using gmime 2.6(.17 -- now updated to .20) a long
time already -- just that `make distclean` does not see that and I've
been looking that part in my build script...

Interestingly when David's changes are pushed I have to edit the distclean
part of my build to find new gmime so it can do that (distclean, that is) 
successfully ;)

IMO it is somewhat akward that `make distclean` executes `./configure`
but that is probably something no-one wants to do anything with...

Tomi


  --dkg
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] cli/lib: remove support for GMime 2.4

2015-08-17 Thread Daniel Kahn Gillmor
On Sun 2015-08-16 21:53:36 +0200, Tomi Ollila wrote:
 On Sun, Aug 16 2015, David Bremner da...@tethera.net wrote:

 It's becoming a maintenance burden to do anything things with the
 crypto glue code twice, once for 2.4 and once for 2.6. I don't have
 any 2.4 version available to test on my development machine anymore,
 so the 2.4 specific code paths are likely not very well tested.
 ---

 I started to rebase the SMIME signature verification patches and got
 aggravated at solving the same conflicts twice in every file.

 2.6.7 is from 2012, so that's a bit newer than some of our
 requirements, but I think not so bad. YMMV.

 Perhaps it is time for me to update to gmime 2.6 in this machine. PITA ;/

Please do, i think gmime 2.4 is really not well-supported upstream any
more either.

 --dkg
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] cli/lib: remove support for GMime 2.4

2015-08-16 Thread David Bremner
It's becoming a maintenance burden to do anything things with the
crypto glue code twice, once for 2.4 and once for 2.6. I don't have
any 2.4 version available to test on my development machine anymore,
so the 2.4 specific code paths are likely not very well tested.
---

I started to rebase the SMIME signature verification patches and got
aggravated at solving the same conflicts twice in every file.

2.6.7 is from 2012, so that's a bit newer than some of our
requirements, but I think not so bad. YMMV.

 INSTALL|  6 ++--
 configure  | 49 ++---
 crypto.c   | 25 -
 mime-node.c| 83 ---
 notmuch-show.c | 87 --
 5 files changed, 17 insertions(+), 233 deletions(-)

diff --git a/INSTALL b/INSTALL
index eaccd93..b1b9cd5 100644
--- a/INSTALL
+++ b/INSTALL
@@ -20,7 +20,7 @@ configure stage.
 
 Dependencies
 
-Notmuch depends on four libraries: Xapian, GMime 2.4 or 2.6,
+Notmuch depends on four libraries: Xapian, GMime 2.6,
 Talloc, and zlib which are each described below:
 
Xapian
@@ -39,8 +39,8 @@ Talloc, and zlib which are each described below:
reading mail while notmuch would wait for Xapian when removing
the inbox and unread tags from messages in a thread.
 
-   GMime 2.4 or 2.6
-   
+   GMime  2.6
+   --
GMime provides decoding of MIME email messages for Notmuch.
 
Without GMime, Notmuch would not be able to extract and index
diff --git a/configure b/configure
index d289880..440d678 100755
--- a/configure
+++ b/configure
@@ -71,16 +71,6 @@ WITH_BASH=1
 WITH_RUBY=1
 WITH_ZSH=1
 
-# Compatible GMime versions (with constraints).
-# If using GMime 2.6, we need to have a version = 2.6.5 to avoid a
-# crypto bug. We need 2.6.7 for permissive From  header handling.
-GMIME_24_VERSION_CTR=''
-GMIME_24_VERSION=gmime-2.4 $GMIME_24_VERSION_CTR
-GMIME_26_VERSION_CTR='= 2.6.7'
-GMIME_26_VERSION=gmime-2.6 $GMIME_26_VERSION_CTR
-
-WITH_GMIME_VERSIONS=$GMIME_26_VERSION;$GMIME_24_VERSION
-
 usage ()
 {
 cat EOF
@@ -140,10 +130,6 @@ Fine tuning of some installation directories is available:
--bashcompletiondir=DIR Bash completions files 
[SYSCONFDIR/bash_completion.d]
--zshcompletiondir=DIR  Zsh completions files 
[PREFIX/share/zsh/functions/Completion/Unix]
 
-Some specific library versions can be specified (auto-detected otherwise):
-
-   --with-gmime-version=VERS   Specify GMIME version (2.4 or 2.6)
-
 Some features can be disabled (--with-feature=no is equivalent to
 --without-feature) :
 
@@ -231,12 +217,6 @@ for option; do
fi
 elif [ ${option} = '--without-zsh-completion' ] ; then
WITH_ZSH=0
-elif [ ${option%%=*} = '--with-gmime-version' ] ; then
-   if [ ${option#*=} = '2.4' ]; then
-WITH_GMIME_VERSIONS=$GMIME_24_VERSION
-elif [ ${option#*=} = '2.6' ]; then
-WITH_GMIME_VERSIONS=$GMIME_26_VERSION
-   fi
 elif [ ${option%%=*} = '--build' ] ; then
true
 elif [ ${option%%=*} = '--host' ] ; then
@@ -391,20 +371,19 @@ if [ ${have_xapian} = 1 ]; then
 esac
 fi
 
+
+# we need to have a version = 2.6.5 to avoid a crypto bug. We need
+# 2.6.7 for permissive From  header handling.
+GMIME_MINVER=2.6.7
+
 printf Checking for GMime development files... 
-have_gmime=0
-IFS=';'
-for gmimepc in $WITH_GMIME_VERSIONS; do
-if pkg-config --exists $gmimepc; then
-   printf Yes ($gmimepc).\n
-   have_gmime=1
-   gmime_cflags=$(pkg-config --cflags $gmimepc)
-   gmime_ldflags=$(pkg-config --libs $gmimepc)
-   break
-fi
-done
-IFS=$DEFAULT_IFS
-if [ $have_gmime = 0 ]; then
+if pkg-config --exists gmime-2.6 = $GMIME_MINVER; then
+printf Yes.\n
+have_gmime=1
+gmime_cflags=$(pkg-config --cflags gmime-2.6)
+gmime_ldflags=$(pkg-config --libs gmime-2.6)
+else
+have_gmime=0
 printf No.\n
 errors=$((errors + 1))
 fi
@@ -640,7 +619,7 @@ EOF
echo
 fi
 if [ $have_gmime -eq 0 ]; then
-   echo   Either GMime 2.4 library $GMIME_24_VERSION_CTR or GMime 2.6 
library $GMIME_26_VERSION_CTR
+   echo   GMime 2.6 library = $GMIME_MINVER
echo   (including development files such as headers)
echo   http://spruce.sourceforge.net/gmime/;
echo
@@ -1026,7 +1005,7 @@ LINKER_RESOLVES_LIBRARY_DEPENDENCIES = 
${linker_resolves_library_dependencies}
 XAPIAN_CXXFLAGS = ${xapian_cxxflags}
 XAPIAN_LDFLAGS = ${xapian_ldflags}
 
-# Flags needed to compile and link against GMime-2.4
+# Flags needed to compile and link against GMime
 GMIME_CFLAGS = ${gmime_cflags}
 GMIME_LDFLAGS = ${gmime_ldflags}
 
diff --git a/crypto.c b/crypto.c
index 026640f..a6eb27d 100644
--- a/crypto.c
+++ b/crypto.c
@@ -20,8 +20,6 @@
 
 #include notmuch-client.h
 
-#ifdef GMIME_ATLEAST_26
-
 /* Create a GPG context (GMime 2.6) */
 static 

Re: [PATCH] cli/lib: remove support for GMime 2.4

2015-08-16 Thread Tomi Ollila
On Sun, Aug 16 2015, David Bremner da...@tethera.net wrote:

 It's becoming a maintenance burden to do anything things with the
 crypto glue code twice, once for 2.4 and once for 2.6. I don't have
 any 2.4 version available to test on my development machine anymore,
 so the 2.4 specific code paths are likely not very well tested.
 ---

 I started to rebase the SMIME signature verification patches and got
 aggravated at solving the same conflicts twice in every file.

 2.6.7 is from 2012, so that's a bit newer than some of our
 requirements, but I think not so bad. YMMV.

Perhaps it is time for me to update to gmime 2.6 in this machine. PITA ;/

Tomi


  INSTALL|  6 ++--
  configure  | 49 ++---
  crypto.c   | 25 -
  mime-node.c| 83 ---
  notmuch-show.c | 87 
 --
  5 files changed, 17 insertions(+), 233 deletions(-)

 diff --git a/INSTALL b/INSTALL
 index eaccd93..b1b9cd5 100644
 --- a/INSTALL
 +++ b/INSTALL
 @@ -20,7 +20,7 @@ configure stage.
  
  Dependencies
  
 -Notmuch depends on four libraries: Xapian, GMime 2.4 or 2.6,
 +Notmuch depends on four libraries: Xapian, GMime 2.6,
  Talloc, and zlib which are each described below:
  
   Xapian
 @@ -39,8 +39,8 @@ Talloc, and zlib which are each described below:
   reading mail while notmuch would wait for Xapian when removing
   the inbox and unread tags from messages in a thread.
  
 - GMime 2.4 or 2.6
 - 
 + GMime  2.6
 + --
   GMime provides decoding of MIME email messages for Notmuch.
  
   Without GMime, Notmuch would not be able to extract and index
 diff --git a/configure b/configure
 index d289880..440d678 100755
 --- a/configure
 +++ b/configure
 @@ -71,16 +71,6 @@ WITH_BASH=1
  WITH_RUBY=1
  WITH_ZSH=1
  
 -# Compatible GMime versions (with constraints).
 -# If using GMime 2.6, we need to have a version = 2.6.5 to avoid a
 -# crypto bug. We need 2.6.7 for permissive From  header handling.
 -GMIME_24_VERSION_CTR=''
 -GMIME_24_VERSION=gmime-2.4 $GMIME_24_VERSION_CTR
 -GMIME_26_VERSION_CTR='= 2.6.7'
 -GMIME_26_VERSION=gmime-2.6 $GMIME_26_VERSION_CTR
 -
 -WITH_GMIME_VERSIONS=$GMIME_26_VERSION;$GMIME_24_VERSION
 -
  usage ()
  {
  cat EOF
 @@ -140,10 +130,6 @@ Fine tuning of some installation directories is 
 available:
   --bashcompletiondir=DIR Bash completions files 
 [SYSCONFDIR/bash_completion.d]
   --zshcompletiondir=DIR  Zsh completions files 
 [PREFIX/share/zsh/functions/Completion/Unix]
  
 -Some specific library versions can be specified (auto-detected otherwise):
 -
 - --with-gmime-version=VERS   Specify GMIME version (2.4 or 2.6)
 -
  Some features can be disabled (--with-feature=no is equivalent to
  --without-feature) :
  
 @@ -231,12 +217,6 @@ for option; do
   fi
  elif [ ${option} = '--without-zsh-completion' ] ; then
   WITH_ZSH=0
 -elif [ ${option%%=*} = '--with-gmime-version' ] ; then
 - if [ ${option#*=} = '2.4' ]; then
 -  WITH_GMIME_VERSIONS=$GMIME_24_VERSION
 -  elif [ ${option#*=} = '2.6' ]; then
 -  WITH_GMIME_VERSIONS=$GMIME_26_VERSION
 - fi
  elif [ ${option%%=*} = '--build' ] ; then
   true
  elif [ ${option%%=*} = '--host' ] ; then
 @@ -391,20 +371,19 @@ if [ ${have_xapian} = 1 ]; then
  esac
  fi
  
 +
 +# we need to have a version = 2.6.5 to avoid a crypto bug. We need
 +# 2.6.7 for permissive From  header handling.
 +GMIME_MINVER=2.6.7
 +
  printf Checking for GMime development files... 
 -have_gmime=0
 -IFS=';'
 -for gmimepc in $WITH_GMIME_VERSIONS; do
 -if pkg-config --exists $gmimepc; then
 - printf Yes ($gmimepc).\n
 - have_gmime=1
 - gmime_cflags=$(pkg-config --cflags $gmimepc)
 - gmime_ldflags=$(pkg-config --libs $gmimepc)
 - break
 -fi
 -done
 -IFS=$DEFAULT_IFS
 -if [ $have_gmime = 0 ]; then
 +if pkg-config --exists gmime-2.6 = $GMIME_MINVER; then
 +printf Yes.\n
 +have_gmime=1
 +gmime_cflags=$(pkg-config --cflags gmime-2.6)
 +gmime_ldflags=$(pkg-config --libs gmime-2.6)
 +else
 +have_gmime=0
  printf No.\n
  errors=$((errors + 1))
  fi
 @@ -640,7 +619,7 @@ EOF
   echo
  fi
  if [ $have_gmime -eq 0 ]; then
 - echo   Either GMime 2.4 library $GMIME_24_VERSION_CTR or GMime 2.6 
 library $GMIME_26_VERSION_CTR
 + echo   GMime 2.6 library = $GMIME_MINVER
   echo   (including development files such as headers)
   echo   http://spruce.sourceforge.net/gmime/;
   echo
 @@ -1026,7 +1005,7 @@ LINKER_RESOLVES_LIBRARY_DEPENDENCIES = 
 ${linker_resolves_library_dependencies}
  XAPIAN_CXXFLAGS = ${xapian_cxxflags}
  XAPIAN_LDFLAGS = ${xapian_ldflags}
  
 -# Flags needed to compile and link against GMime-2.4
 +# Flags needed to compile and link against GMime
  GMIME_CFLAGS = ${gmime_cflags}
  GMIME_LDFLAGS = ${gmime_ldflags}