1 Return-Path: <felipe.contreras@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 1A38A431FD0
\r
6 for <notmuch@notmuchmail.org>; Fri, 23 May 2014 03:45:55 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id gf7BtOAXzUkf for <notmuch@notmuchmail.org>;
\r
17 Fri, 23 May 2014 03:45:51 -0700 (PDT)
\r
18 Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com
\r
19 [209.85.214.170]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 24939431FC4
\r
22 for <notmuch@notmuchmail.org>; Fri, 23 May 2014 03:45:50 -0700 (PDT)
\r
23 Received: by mail-ob0-f170.google.com with SMTP id uy5so5156871obc.15
\r
24 for <notmuch@notmuchmail.org>; Fri, 23 May 2014 03:45:49 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
26 h=from:to:cc:subject:date:message-id:in-reply-to:references;
\r
27 bh=YOeG9VXKwV0EKaXSe98Kd+vL9DXgloEni278dpjGgzE=;
\r
28 b=ynrtrAdU+HeILdItPO4trNHuu/d7UIYqeErtk55lUeI464OnUA1helwq70c7oPsxnT
\r
29 BmJbs4CC9PUgTnJN309hef3xSircUDXY36sWUWTkC5YirQPcMYjRILAqgWsj4S62i7mE
\r
30 OVVF5kCVDw+362Q0MmUoJNxWBYXrjZhI17mHIDT/x3+6H5kpBIcf/XkCYTYlaQmlfZCR
\r
31 VvFFVshwKdjjhyUGDJDC/Nkc1X+l/Qaabzm7ojefJae0Ay+K4rZuptPw++skD6zwRAUn
\r
32 hvhA/s6qrBvldg6btPa9UEOT1sD6kYzmsJmqjirupVPUQpgCUVTpq0uorfzfRwVoEngw
\r
34 X-Received: by 10.60.92.170 with SMTP id cn10mr1991765oeb.76.1400841949764;
\r
35 Fri, 23 May 2014 03:45:49 -0700 (PDT)
\r
36 Received: from localhost (189-211-224-40.static.axtel.net. [189.211.224.40])
\r
37 by mx.google.com with ESMTPSA id
\r
38 zv18sm4857197obb.27.2014.05.23.03.45.48 for <multiple recipients>
\r
39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
40 Fri, 23 May 2014 03:45:49 -0700 (PDT)
\r
41 From: Felipe Contreras <felipe.contreras@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH 2/3] build: add support to build Ruby bindings
\r
44 Date: Fri, 23 May 2014 05:34:26 -0500
\r
45 Message-Id: <1400841267-12807-3-git-send-email-felipe.contreras@gmail.com>
\r
46 X-Mailer: git-send-email 1.9.3+fc1~5~gfaddd51
\r
47 In-Reply-To: <1400841267-12807-1-git-send-email-felipe.contreras@gmail.com>
\r
48 References: <1400841267-12807-1-git-send-email-felipe.contreras@gmail.com>
\r
49 Cc: Ali Polatel <alip@exherbo.org>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Fri, 23 May 2014 10:45:55 -0000
\r
64 So there's no need for the user to manually do that.
\r
66 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
\r
68 bindings/ruby/Makefile.local | 21 +++++++++++++++++++++
\r
69 bindings/ruby/extconf.rb | 14 ++------------
\r
70 configure | 21 +++++++++++++++++++++
\r
71 3 files changed, 44 insertions(+), 12 deletions(-)
\r
72 create mode 100644 bindings/ruby/Makefile.local
\r
74 diff --git a/bindings/ruby/Makefile.local b/bindings/ruby/Makefile.local
\r
75 new file mode 100644
\r
76 index 0000000..8b1837c
\r
78 +++ b/bindings/ruby/Makefile.local
\r
80 +dir := bindings/ruby
\r
82 +ifeq ($(WITH_RUBY),1)
\r
83 +all: $(dir)/notmuch.so
\r
84 +install: install-ruby
\r
88 +$(dir)/Makefile: $(dir)/extconf.rb
\r
89 + @ruby -C $(dir) extconf.rb --vendor
\r
91 +$(dir)/notmuch.so: | $(dir)/Makefile lib/libnotmuch.so
\r
92 + @$(MAKE) -C $(dir) notmuch.so
\r
94 +install-ruby: | $(dir)/Makefile
\r
95 + @$(MAKE) -C $(dir) install prefix=$(DESTDIR)/$(prefix)
\r
97 +clean-ruby: | $(dir)/Makefile
\r
98 + $(MAKE) -C $(dir) clean
\r
100 +.PHONY: install-ruby
\r
101 diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb
\r
102 index 6160db2..abd67fc 100644
\r
103 --- a/bindings/ruby/extconf.rb
\r
104 +++ b/bindings/ruby/extconf.rb
\r
105 @@ -13,18 +13,8 @@ $INCFLAGS = "-I#{dir} #{$INCFLAGS}"
\r
106 # make sure there are no undefined symbols
\r
107 $LDFLAGS += ' -Wl,--no-undefined'
\r
109 -def have_local_library(lib, path, func, headers = nil)
\r
110 - checking_for checking_message(func, lib) do
\r
111 - lib = File.join(path, lib)
\r
112 - if try_func(func, lib, headers)
\r
113 - $LOCAL_LIBS += lib
\r
118 -if not have_local_library('libnotmuch.so', dir, 'notmuch_database_create', 'notmuch.h')
\r
122 +$LOCAL_LIBS += "#{dir}/libnotmuch.so"
\r
125 dir_config('notmuch')
\r
126 diff --git a/configure b/configure
\r
127 index 9bde2eb..3bdf6d7 100755
\r
130 @@ -21,6 +21,7 @@ srcdir=$(dirname "$0")
\r
132 subdirs="util compat lib parse-time-string completion doc emacs"
\r
133 subdirs="${subdirs} performance-test test test/test-databases"
\r
134 +subdirs="${subdirs} bindings/ruby"
\r
136 # For a non-srcdir configure invocation (such as ../configure), create
\r
137 # the directory structure and copy Makefiles.
\r
138 @@ -65,6 +66,7 @@ LIBDIR=
\r
144 # Compatible GMime versions (with constraints).
\r
145 # If using GMime 2.6, we need to have a version >= 2.6.5 to avoid a
\r
146 @@ -212,6 +214,14 @@ for option; do
\r
147 elif [ "${option#*=}" = '2.6' ]; then
\r
148 WITH_GMIME_VERSIONS=$GMIME_26_VERSION
\r
150 + elif [ "${option%%=*}" = '--with-ruby' ]; then
\r
151 + if [ "${option#*=}" = 'no' ]; then
\r
156 + elif [ "${option}" = '--without-ruby' ] ; then
\r
158 elif [ "${option%%=*}" = '--build' ] ; then
\r
160 elif [ "${option%%=*}" = '--host' ] ; then
\r
161 @@ -383,6 +393,14 @@ else
\r
165 +printf "Checking for ruby... "
\r
166 +if pkg-config --exists ruby-2.1; then
\r
169 + printf "No (will not install Ruby bindings).\n"
\r
173 if [ -z "${EMACSLISPDIR}" ]; then
\r
174 if pkg-config --exists emacs; then
\r
175 EMACSLISPDIR=$(pkg-config emacs --variable sitepkglispdir)
\r
176 @@ -906,6 +924,9 @@ WITH_BASH = ${WITH_BASH}
\r
177 # Support for zsh completion
\r
178 WITH_ZSH = ${WITH_ZSH}
\r
180 +# Support for Ruby
\r
181 +WITH_RUBY = ${WITH_RUBY}
\r
183 # Combined flags for compiling and linking against all of the above
\r
184 CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\r
185 -DHAVE_CANONICALIZE_FILE_NAME=\$(HAVE_CANONICALIZE_FILE_NAME) \\
\r
187 1.9.3+fc1~5~gfaddd51
\r