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