[PATCH 3/4] ruby: Add workarounds to use in-tree build not the installed one
authorAli Polatel <alip@exherbo.org>
Mon, 7 May 2012 15:02:45 +0000 (18:02 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:58 +0000 (09:46 -0800)
e7/4eba943544902f6e3a7144e8e53d9810e30e1f [new file with mode: 0644]

diff --git a/e7/4eba943544902f6e3a7144e8e53d9810e30e1f b/e7/4eba943544902f6e3a7144e8e53d9810e30e1f
new file mode 100644 (file)
index 0000000..572a8cf
--- /dev/null
@@ -0,0 +1,147 @@
+Return-Path: <polatel@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 3834C431FAE\r
+       for <notmuch@notmuchmail.org>; Mon,  7 May 2012 08:03:42 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+       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 rQIq-nMgn5vA for <notmuch@notmuchmail.org>;\r
+       Mon,  7 May 2012 08:03:41 -0700 (PDT)\r
+Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com\r
+       [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 8C320431FDC\r
+       for <notmuch@notmuchmail.org>; Mon,  7 May 2012 08:03:40 -0700 (PDT)\r
+Received: by wibhn9 with SMTP id hn9so512021wib.2\r
+       for <notmuch@notmuchmail.org>; Mon, 07 May 2012 08:03:39 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
+       :references:in-reply-to:references:organization:mime-version\r
+       :content-type:content-transfer-encoding;\r
+       bh=+gllX4WTDJuFNWyXsE0YglJvaJrsISvNFUhZ9cuSM4g=;\r
+       b=Tmbpsm59Zrlbl+sQXskRzCQ73QE/aRXM0t4pktCLsUGJ2Kra2LV/KzpdDGTDISmGwA\r
+       +9P4rgvOF3KJkg/IrP9F8y39mdPW2KDYY+u4L3NTW2/78P/UxlW/Au+4oEBKIZ0eBbDR\r
+       yAAwapEGqRSs7TPH07OhCiIVD+/GN4jwZo9ZsplMaYayK8Kfs2SSfHVF1jkmbswjm+NY\r
+       EOo4ido6yzcQ09rpKIC0SQCPSP8FXAD9DpnJQO8h3p43tBawDPK2XvTXiEwa8I1ZKPJ+\r
+       YmL7NclRiiHhh5nUKdePGAGKvubSgy5woG2Vj/or2E1CyJysioegcaOOpE/1bDZfKP1K\r
+       66Ag==\r
+Received: by 10.216.132.150 with SMTP id o22mr5248250wei.109.1336403019175;\r
+       Mon, 07 May 2012 08:03:39 -0700 (PDT)\r
+Received: from hayalet.ev ([88.234.38.242])\r
+       by mx.google.com with ESMTPS id ff2sm34852610wib.9.2012.05.07.08.03.38\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 07 May 2012 08:03:38 -0700 (PDT)\r
+Sender: Ali Polatel <polatel@gmail.com>\r
+From: Ali Polatel <alip@exherbo.org>\r
+To: David Bremner <bremner@unb.ca>\r
+Subject:\r
+ [PATCH 3/4] ruby: Add workarounds to use in-tree build not the installed one\r
+Date: Mon,  7 May 2012 18:02:45 +0300\r
+Message-Id:\r
+ <1559639bc5e9e3253f2ee2220a8d8d00c39d9d43.1336402558.git.alip@exherbo.org>\r
+X-Mailer: git-send-email 1.7.10.1\r
+In-Reply-To: <cover.1336402558.git.alip@exherbo.org>\r
+References: <87txzsgs4g.fsf@zancas.localnet>\r
+       <cover.1336402558.git.alip@exherbo.org>\r
+In-Reply-To: <cover.1336402558.git.alip@exherbo.org>\r
+References: <cover.1336402558.git.alip@exherbo.org>\r
+Organization: Pink Floyd\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+Cc: Ali Polatel <alip@exherbo.org>, 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: Mon, 07 May 2012 15:03:42 -0000\r
+\r
+- Make mkmf use the notmuch.h under ../../lib\r
+- Use libnotmuch.a instead of linking to the installed libnotmuch.so\r
+---\r
+ bindings/ruby/defs.h     |    4 ++--\r
+ bindings/ruby/extconf.rb |   26 ++++++++++++++++++++++----\r
+ 2 files changed, 24 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h\r
+index a41cf10..6fe5787 100644\r
+--- a/bindings/ruby/defs.h\r
++++ b/bindings/ruby/defs.h\r
+@@ -1,6 +1,6 @@\r
+ /* The Ruby interface to the notmuch mail library\r
+  *\r
+- * Copyright © 2010, 2011 Ali Polatel\r
++ * Copyright © 2010, 2011, 2012 Ali Polatel\r
+  *\r
+  * This program is free software: you can redistribute it and/or modify\r
+  * it under the terms of the GNU General Public License as published by\r
+@@ -21,8 +21,8 @@\r
+ #ifndef DEFS_H\r
+ #define DEFS_H\r
+ \r
+-#include <notmuch.h>\r
+ #include <ruby.h>\r
++#include "notmuch.h"\r
+ \r
+ VALUE notmuch_rb_cDatabase;\r
+ VALUE notmuch_rb_cDirectory;\r
+diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb\r
+index ccac609..933f34a 100644\r
+--- a/bindings/ruby/extconf.rb\r
++++ b/bindings/ruby/extconf.rb\r
+@@ -1,13 +1,31 @@\r
+ #!/usr/bin/env ruby\r
+ # coding: utf-8\r
+-# Copyright 2010, 2011 Ali Polatel <alip@exherbo.org>\r
++# Copyright 2010, 2011, 2012 Ali Polatel <alip@exherbo.org>\r
+ # Distributed under the terms of the GNU General Public License v3\r
+ \r
+ require 'mkmf'\r
+ \r
+-# Notmuch Library\r
+-find_header('notmuch.h', '../../lib')\r
+-find_library('notmuch', 'notmuch_database_create', '../../lib')\r
++NOTDIR = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))\r
++NOTHDR = File.join(NOTDIR, 'notmuch.h')\r
++NOTLIB = File.join(NOTDIR, 'libnotmuch.a')\r
++\r
++unless File.exists? NOTHDR\r
++  $stderr.puts "notmuch.h is missing under #{NOTDIR}"\r
++  exit 1\r
++end\r
++\r
++unless File.exists? NOTLIB\r
++  $stderr.puts "libnotmuch.a is missing under #{NOTDIR}"\r
++  exit 1\r
++end\r
++\r
++# Small hack to build with in-tree version not the installed one.\r
++# find_header() and friends use standard include/library paths first.\r
++$stderr.puts "Added -I#{NOTDIR} to $INCFLAGS"\r
++$INCFLAGS = "-I#{NOTDIR}".quote + " " + $INCFLAGS\r
++find_header('notmuch.h', NOTDIR)\r
++\r
++$LOCAL_LIBS += NOTLIB\r
+ \r
+ # Create Makefile\r
+ dir_config('notmuch')\r
+-- \r
+1.7.10.1\r
+\r