unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Ali Polatel <alip@exherbo.org>
To: David Bremner <bremner@unb.ca>
Cc: Ali Polatel <alip@exherbo.org>, notmuch@notmuchmail.org
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	[thread overview]
Message-ID: <1559639bc5e9e3253f2ee2220a8d8d00c39d9d43.1336402558.git.alip@exherbo.org> (raw)
In-Reply-To: <cover.1336402558.git.alip@exherbo.org>
In-Reply-To: <cover.1336402558.git.alip@exherbo.org>

- 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 <notmuch.h>
 #include <ruby.h>
+#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 <alip@exherbo.org>
+# Copyright 2010, 2011, 2012 Ali Polatel <alip@exherbo.org>
 # 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

  parent reply	other threads:[~2012-05-07 15:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87txzsgs4g.fsf@zancas.localnet>
2012-05-07 15:02 ` [PATCH 0/4] ruby: quick update before the freeze! Ali Polatel
2012-05-07 15:02   ` [PATCH 1/4] ruby: Add wrapper for notmuch_query_count_messages Ali Polatel
2012-05-07 15:02   ` [PATCH 2/4] ruby: Add wrapper for notmuch_query_add_tag_exclude Ali Polatel
2012-05-07 15:02   ` Ali Polatel [this message]
2012-05-23 22:02     ` [PATCH 3/4] ruby: Add workarounds to use in-tree build not the installed one Felipe Contreras
2012-05-24  1:22       ` David Bremner
2012-05-24  8:56         ` Felipe Contreras
2012-05-25 13:13           ` Felipe Contreras
2012-05-26  0:38             ` David Bremner
2012-05-07 15:02   ` [PATCH 4/4] ruby: Add wrapper for notmuch_query_set_omit_excluded() Ali Polatel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1559639bc5e9e3253f2ee2220a8d8d00c39d9d43.1336402558.git.alip@exherbo.org \
    --to=alip@exherbo.org \
    --cc=bremner@unb.ca \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).