--- /dev/null
+Return-Path: <wael.nasreddine@gmail.com>\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 30CF8431FC4\r
+ for <notmuch@notmuchmail.org>; Fri, 23 May 2014 08:05:12 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 fcAw2EB7hej6 for <notmuch@notmuchmail.org>;\r
+ Fri, 23 May 2014 08:05:04 -0700 (PDT)\r
+Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com\r
+ [209.85.160.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id CD54E431FBF\r
+ for <notmuch@notmuchmail.org>; Fri, 23 May 2014 08:05:04 -0700 (PDT)\r
+Received: by mail-pb0-f52.google.com with SMTP id rr13so4298242pbb.11\r
+ for <notmuch@notmuchmail.org>; Fri, 23 May 2014 08:05:04 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+ :message-id:mime-version:content-type;\r
+ bh=0loDcWV4TJExt85MSt/AzL11HcWD3NmgbGcUetjV5Kw=;\r
+ b=qW9DysoR35D/obOVHiGXLh1fPFTBT7/iqeWYKoajlJm7u9KgYPqxX63d24XszR8vFQ\r
+ JoYaQaYwOEa/UG1w1VRmmd+i2ijeCZ/cAx9lbq8VgkNbmA2wu0o7vDbJepO+epkhrYZY\r
+ Yc8hqEx9U9/A2pXTcanm8H46rEFJgpbfdEHtHy5y02NkL/34Nd8S4XYN6RTq3vRkpzD9\r
+ bkgmwc8/Ky2VKgS1YNlUGMW3RQuiVPpyqHYorn9DGBjIpGwoo2C9m2zNczetc6mJeYB5\r
+ DpvuGvvgthJpjcW036HlO2P6r/sEUEXcBGaJ551XKk5eNnTuFKEdQ8xtkqn2fnCR5qn9\r
+ 4e+w==\r
+X-Received: by 10.66.124.163 with SMTP id mj3mr6830414pab.38.1400857504046;\r
+ Fri, 23 May 2014 08:05:04 -0700 (PDT)\r
+Received: from localhost ([2620:0:1000:2e00:ec3f:a511:27dc:adef])\r
+ by mx.google.com with ESMTPSA id no9sm5058063pbc.83.2014.05.23.08.05.01\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Fri, 23 May 2014 08:05:02 -0700 (PDT)\r
+From: Wael Nasreddine <wael.nasreddine@gmail.com>\r
+To: Felipe Contreras <felipe.contreras@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 2/3] build: add support to build Ruby bindings\r
+In-Reply-To: <1400841267-12807-3-git-send-email-felipe.contreras@gmail.com>\r
+References: <1400841267-12807-1-git-send-email-felipe.contreras@gmail.com>\r
+ <1400841267-12807-3-git-send-email-felipe.contreras@gmail.com>\r
+User-Agent: Notmuch/0.18+10~g7d81d70 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Fri, 23 May 2014 08:04:57 -0700\r
+Message-ID: <w52c61kwh6xy.fsf@gaea.mtv.corp.google.com>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed; boundary="=-=-="\r
+Cc: Ali Polatel <alip@exherbo.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, 23 May 2014 15:05:12 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+Felipe Contreras <felipe.contreras@gmail.com> writes:\r
+\r
+> So there's no need for the user to manually do that.\r
+>\r
+> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+> ---\r
+> bindings/ruby/Makefile.local | 21 +++++++++++++++++++++\r
+> bindings/ruby/extconf.rb | 14 ++------------\r
+> configure | 21 +++++++++++++++++++++\r
+> 3 files changed, 44 insertions(+), 12 deletions(-)\r
+> create mode 100644 bindings/ruby/Makefile.local\r
+>\r
+> diff --git a/bindings/ruby/Makefile.local b/bindings/ruby/Makefile.local\r
+> new file mode 100644\r
+> index 0000000..8b1837c\r
+> --- /dev/null\r
+> +++ b/bindings/ruby/Makefile.local\r
+> @@ -0,0 +1,21 @@\r
+> +dir := bindings/ruby\r
+> +\r
+> +ifeq ($(WITH_RUBY),1)\r
+> +all: $(dir)/notmuch.so\r
+> +install: install-ruby\r
+> +clean: clean-ruby\r
+> +endif\r
+> +\r
+> +$(dir)/Makefile: $(dir)/extconf.rb\r
+> + @ruby -C $(dir) extconf.rb --vendor\r
+> +\r
+> +$(dir)/notmuch.so: | $(dir)/Makefile lib/libnotmuch.so\r
+> + @$(MAKE) -C $(dir) notmuch.so\r
+> +\r
+> +install-ruby: | $(dir)/Makefile\r
+> + @$(MAKE) -C $(dir) install prefix=$(DESTDIR)/$(prefix)\r
+> +\r
+> +clean-ruby: | $(dir)/Makefile\r
+> + $(MAKE) -C $(dir) clean\r
+> +\r
+> +.PHONY: install-ruby\r
+> diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb\r
+> index 6160db2..abd67fc 100644\r
+> --- a/bindings/ruby/extconf.rb\r
+> +++ b/bindings/ruby/extconf.rb\r
+> @@ -13,18 +13,8 @@ $INCFLAGS = "-I#{dir} #{$INCFLAGS}"\r
+> # make sure there are no undefined symbols\r
+> $LDFLAGS += ' -Wl,--no-undefined'\r
+> \r
+> -def have_local_library(lib, path, func, headers = nil)\r
+> - checking_for checking_message(func, lib) do\r
+> - lib = File.join(path, lib)\r
+> - if try_func(func, lib, headers)\r
+> - $LOCAL_LIBS += lib\r
+> - end\r
+> - end\r
+> -end\r
+> -\r
+> -if not have_local_library('libnotmuch.so', dir, 'notmuch_database_create', 'notmuch.h')\r
+> - exit 1\r
+> -end\r
+> +# library\r
+> +$LOCAL_LIBS += "#{dir}/libnotmuch.so"\r
+> \r
+> # Create Makefile\r
+> dir_config('notmuch')\r
+> diff --git a/configure b/configure\r
+> index 9bde2eb..3bdf6d7 100755\r
+> --- a/configure\r
+> +++ b/configure\r
+> @@ -21,6 +21,7 @@ srcdir=$(dirname "$0")\r
+> \r
+> subdirs="util compat lib parse-time-string completion doc emacs"\r
+> subdirs="${subdirs} performance-test test test/test-databases"\r
+> +subdirs="${subdirs} bindings/ruby"\r
+> \r
+> # For a non-srcdir configure invocation (such as ../configure), create\r
+> # the directory structure and copy Makefiles.\r
+> @@ -65,6 +66,7 @@ LIBDIR=\r
+> WITH_EMACS=1\r
+> WITH_BASH=1\r
+> WITH_ZSH=1\r
+> +WITH_RUBY=1\r
+> \r
+> # Compatible GMime versions (with constraints).\r
+> # If using GMime 2.6, we need to have a version >= 2.6.5 to avoid a\r
+> @@ -212,6 +214,14 @@ for option; do\r
+> elif [ "${option#*=}" = '2.6' ]; then\r
+> WITH_GMIME_VERSIONS=$GMIME_26_VERSION\r
+> fi\r
+> + elif [ "${option%%=*}" = '--with-ruby' ]; then\r
+> + if [ "${option#*=}" = 'no' ]; then\r
+> + WITH_RUBY=0\r
+> + else\r
+> + WITH_RUBY=1\r
+> + fi\r
+> + elif [ "${option}" = '--without-ruby' ] ; then\r
+> + WITH_RUBY=0\r
+> elif [ "${option%%=*}" = '--build' ] ; then\r
+> true\r
+> elif [ "${option%%=*}" = '--host' ] ; then\r
+> @@ -383,6 +393,14 @@ else\r
+> WITH_BASH=0\r
+> fi\r
+> \r
+> +printf "Checking for ruby... "\r
+> +if pkg-config --exists ruby-2.1; then\r
+Why don't you do an OR check for ruby 1.9, 2.0 and 2.1 allowing it to\r
+build with any Ruby version?\r
+\r
+> + printf "Yes.\n"\r
+> +else\r
+> + printf "No (will not install Ruby bindings).\n"\r
+> + WITH_RUBY=0\r
+> +fi\r
+> +\r
+> if [ -z "${EMACSLISPDIR}" ]; then\r
+> if pkg-config --exists emacs; then\r
+> EMACSLISPDIR=$(pkg-config emacs --variable sitepkglispdir)\r
+> @@ -906,6 +924,9 @@ WITH_BASH = ${WITH_BASH}\r
+> # Support for zsh completion\r
+> WITH_ZSH = ${WITH_ZSH}\r
+> \r
+> +# Support for Ruby\r
+> +WITH_RUBY = ${WITH_RUBY}\r
+> +\r
+> # Combined flags for compiling and linking against all of the above\r
+> CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\\r
+> -DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\\r
+> -- \r
+> 1.9.3+fc1~5~gfaddd51\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+\r
+--=-=-=\r
+Content-Type: multipart/signed; boundary="==-=-=";\r
+ micalg=pgp-sha1; protocol="application/pgp-signature"\r
+\r
+--==-=-=\r
+Content-Type: text/plain\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+=2D-=20\r
+Wael Nasreddine | SRE at Google | wael.nasreddine@gmail.com | (650) 735-1773\r
+\r
+--==-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1\r
+\r
+iEYEARECAAYFAlN/Y5kACgkQVWU5RcjdGKL6JwCgp84Bd8O94oUEZvqD/iFNzoJQ\r
+S1IAn10tie1PhxKN4EvEDzdjyD8ugxgs\r
+=xJvY\r
+-----END PGP SIGNATURE-----\r
+--==-=-=--\r
+\r
+--=-=-=--\r