--- /dev/null
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 1457E431FAF\r
+ for <notmuch@notmuchmail.org>; Fri, 18 Apr 2014 01:23:28 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id dNoY5WNX1-6g for <notmuch@notmuchmail.org>;\r
+ Fri, 18 Apr 2014 01:23:24 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 6A21A431FAE\r
+ for <notmuch@notmuchmail.org>; Fri, 18 Apr 2014 01:23:24 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 348D51000C1; Fri, 18 Apr 2014 11:23:18 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: astreib@indiana.edu\r
+Subject: [SUPPORTIVE PATCH 0.17.200] build and use statically linked\r
+ zlib-1.2.8 with notmuch\r
+Date: Fri, 18 Apr 2014 11:23:06 +0300\r
+Message-Id: <1397809386-23356-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+In-Reply-To: <877g6ny3iw.fsf@maritornes.cs.unb.ca>\r
+References: <877g6ny3iw.fsf@maritornes.cs.unb.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 18 Apr 2014 08:23:28 -0000\r
+\r
+¡¡ NOT TO BE MERGED TO NOTMUCH REPOSITORY !!\r
+\r
+(Due to its intrusive nature this patch is not suitable for merging.)\r
+\r
+Recent notmuch(*) requires zlib 1.2.5.2 or newer; systems that have older\r
+versions of zlib installed can use this patch to use zlib 1.2.8 with\r
+notmuch but keep the current one to be used by default.\r
+\r
+Note that zlib 1.2.8 will be downloaded (if not already there) and built\r
+during ./configure time.\r
+\r
+(since ~ 0.17-194-g3921d23 -- Sat 2014-04-12)\r
+---\r
+\r
+HTH :)\r
+\r
+Tomi\r
+\r
+ Makefile.local | 7 ++--\r
+ compat/build-zlib.py | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ configure | 7 ++++\r
+ 3 files changed, 108 insertions(+), 2 deletions(-)\r
+ create mode 100755 compat/build-zlib.py\r
+\r
+diff --git a/Makefile.local b/Makefile.local\r
+index 877a979..1780cee 100644\r
+--- a/Makefile.local\r
++++ b/Makefile.local\r
+@@ -292,11 +292,14 @@ notmuch_client_modules = $(notmuch_client_srcs:.c=.o)\r
+ \r
+ notmuch.o: version.stamp\r
+ \r
++# XXX ZA used in unofficial supportive patch which uses self-built zlib XXX\r
++ZA=./compat/zlib-1.2.8/libz.a\r
++\r
+ notmuch: $(notmuch_client_modules) lib/libnotmuch.a util/libutil.a parse-time-string/libparse-time-string.a\r
+- $(call quiet,CXX $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@\r
++ $(call quiet,CXX $(CFLAGS)) $^ $(ZA) $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@\r
+ \r
+ notmuch-shared: $(notmuch_client_modules) lib/$(LINKER_NAME)\r
+- $(call quiet,$(FINAL_NOTMUCH_LINKER) $(CFLAGS)) $(notmuch_client_modules) $(FINAL_NOTMUCH_LDFLAGS) -o $@\r
++ $(call quiet,$(FINAL_NOTMUCH_LINKER) $(CFLAGS)) $(notmuch_client_modules) $(ZA) $(FINAL_NOTMUCH_LDFLAGS) -o $@\r
+ \r
+ .PHONY: install\r
+ install: all install-man\r
+diff --git a/compat/build-zlib.py b/compat/build-zlib.py\r
+new file mode 100755\r
+index 0000000..25e21d9\r
+--- /dev/null\r
++++ b/compat/build-zlib.py\r
+@@ -0,0 +1,96 @@\r
++#!/usr/bin/env python\r
++# -*- coding: utf-8 -*-\r
++# $ build-zlib.py $\r
++#\r
++# Authors: Tomi Ollila,\r
++# License: Public Domain\r
++#\r
++# Created: Sat 12 Apr 2014 17:51:42 EEST too\r
++# Last modified: Sat 12 Apr 2014 18:52:06 +0300 too\r
++\r
++# Not using string.format() for python 2.5 compatibility.\r
++# Not using print due to python version 2 & 3 differences.\r
++\r
++# The seemlingly extra 'pass'es work with python mode provided\r
++# with Emacs 24.1 and earlier (indentation!)...\r
++\r
++import sys\r
++import os\r
++try: # Python 3\r
++ from urllib.request import urlopen\r
++except ImportError: # Python 2\r
++ from urllib import urlopen\r
++import shutil\r
++import hashlib\r
++\r
++ZLIBurl='http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz?download'\r
++ZLIBtgz='zlib-1.2.8.tar.gz'\r
++ZLIBsum='36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d'\r
++ZLIBdir='zlib-1.2.8'\r
++\r
++\r
++class Die(Exception):\r
++ def __init__(self, *_list):\r
++ sys.stderr.write("\n")\r
++ sys.stderr.write(_list[0] % _list[1:])\r
++ sys.stderr.write("\n\n")\r
++ raise SystemExit(1)\r
++ pass\r
++\r
++\r
++def dl_zlibtgz():\r
++ sys.stdout.write("Downloading %s...\n" % ZLIBtgz)\r
++ response = urlopen(ZLIBurl)\r
++ # python3 throws urllib.error.HTTPError, python2 does not.\r
++ if response.getcode() != 200:\r
++ sys.stderr.write(response.read(4096)) # max 4096 octets\r
++ exit(1)\r
++ outfile = open(ZLIBtgz, 'wb')\r
++ shutil.copyfileobj(response, outfile)\r
++ pass\r
++\r
++\r
++def main():\r
++ if not os.path.isfile(ZLIBtgz):\r
++ dl_zlibtgz()\r
++ pass\r
++\r
++ sys.stdout.write("Checksumming %s...\n" % ZLIBtgz)\r
++ infile = open(ZLIBtgz, 'rb')\r
++ sha256 = hashlib.sha256()\r
++ while True:\r
++ data = infile.read(65536)\r
++ if not data:\r
++ break\r
++ sha256.update(data)\r
++ pass\r
++ sys.stdout.write(" Expt'd sha256 %s\n" % ZLIBsum)\r
++ hexdigest = sha256.hexdigest()\r
++ sys.stdout.write(" Actual sha256 %s\n" % hexdigest)\r
++ if hexdigest != ZLIBsum:\r
++ raise Die("File '%s' checksum mismatch", ZLIBtgz)\r
++ pass\r
++\r
++ target = ZLIBdir + '/libz.a'\r
++ if os.path.isfile(target):\r
++ sys.stdout.write("'%s' exists. OK.\n" % target)\r
++ raise SystemExit(0)\r
++\r
++ def x(*args):\r
++ sys.stdout.write('x ' + ' '.join(args) + '\n')\r
++ os.spawnvp(os.P_WAIT, args[0], args)\r
++ pass\r
++\r
++ sys.stdout.write('Building %s\n' % ZLIBdir)\r
++ x ('rm', '-rf', ZLIBdir)\r
++ x ('tar', '-zxf', ZLIBtgz)\r
++ os.chdir(ZLIBdir)\r
++ x ('./configure')\r
++ x ('make')\r
++ os.chdir('..')\r
++ if not os.path.isfile(target):\r
++ raise Die("Could not build '%s' for some reason!", target)\r
++\r
++if __name__ == '__main__':\r
++ main()\r
++ pass # pylint: disable=W0107\r
+diff --git a/configure b/configure\r
+index f447581..4ba0403 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -342,6 +342,13 @@ fi\r
+ \r
+ printf "Checking for zlib (>= 1.2.5.2)... "\r
+ have_zlib=0\r
++# XXX unofficial supportive patch to use self-built zlib XXX\r
++printf "Checking/building zlib 1.2.8:\n"\r
++(cd compat; exec ../"$srcdir"/compat/build-zlib.py)\r
++have_zlib=1\r
++zlib_cflags="-I ./compat/zlib-1.2.8"\r
++zlib_ldflags=\r
++: ||\r
+ if pkg-config --atleast-version=1.2.5.2 zlib; then\r
+ printf "Yes.\n"\r
+ have_zlib=1\r
+-- \r
+1.8.0\r
+\r