From 1776ebec58f21c360a08e83eafd880c4794388d0 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Tue, 30 Dec 2014 21:29:36 +0100 Subject: [PATCH] [Patch v2 1/5] build: integrate building ruby bindings into notmuch build process --- d9/ffb59a6e823a3cbc78bb481d5ea1c33027a358 | 150 ++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 d9/ffb59a6e823a3cbc78bb481d5ea1c33027a358 diff --git a/d9/ffb59a6e823a3cbc78bb481d5ea1c33027a358 b/d9/ffb59a6e823a3cbc78bb481d5ea1c33027a358 new file mode 100644 index 000000000..3a44a11ff --- /dev/null +++ b/d9/ffb59a6e823a3cbc78bb481d5ea1c33027a358 @@ -0,0 +1,150 @@ +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 28497429E30 + for ; Tue, 30 Dec 2014 12:30:43 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 mDyxwgllZz7r for ; + Tue, 30 Dec 2014 12:30:42 -0800 (PST) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 9042B431FD4 + for ; Tue, 30 Dec 2014 12:30:41 -0800 (PST) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1Y63RB-00010C-7k; Tue, 30 Dec 2014 16:30:41 -0400 +Received: (nullmailer pid 10591 invoked by uid 1000); Tue, 30 Dec 2014 + 20:29:44 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v2 1/5] build: integrate building ruby bindings into notmuch + build process +Date: Tue, 30 Dec 2014 21:29:36 +0100 +Message-Id: <1419971380-10307-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.3 +In-Reply-To: <1419971380-10307-1-git-send-email-david@tethera.net> +References: <1419971380-10307-1-git-send-email-david@tethera.net> +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: Tue, 30 Dec 2014 20:30:43 -0000 + +Because ruby generates a Makefile, we have to use recursive make. +Because mkmf.rb hardcodes the name Makefile, put our Makefile{.local} +in the parent directory. +--- + bindings/Makefile | 7 +++++++ + bindings/Makefile.local | 18 ++++++++++++++++++ + configure | 18 ++++++++++++++++++ + 3 files changed, 43 insertions(+) + create mode 100644 bindings/Makefile + create mode 100644 bindings/Makefile.local + +diff --git a/bindings/Makefile b/bindings/Makefile +new file mode 100644 +index 0000000..de492a7 +--- /dev/null ++++ b/bindings/Makefile +@@ -0,0 +1,7 @@ ++# See Makefile.local for the list of files to be compiled in this ++# directory. ++all: ++ $(MAKE) -C .. all ++ ++.DEFAULT: ++ $(MAKE) -C .. $@ +diff --git a/bindings/Makefile.local b/bindings/Makefile.local +new file mode 100644 +index 0000000..f395c81 +--- /dev/null ++++ b/bindings/Makefile.local +@@ -0,0 +1,18 @@ ++# -*- makefile -*- ++ ++dir := bindings ++ ++# force the shared library to be build ++ruby-bindings: lib/libnotmuch.so ++ifeq ($(HAVE_RUBY_DEV),1) ++ cd $(dir)/ruby && ruby extconf.rb ++ $(MAKE) -C $(dir)/ruby ++else ++ @echo Missing dependency, skipping ruby bindings ++endif ++ ++CLEAN += $(patsubst %,$(dir)/ruby/%, \ ++ Makefile database.o directory.o filenames.o\ ++ init.o message.o messages.o mkmf.log notmuch.so query.o \ ++ status.o tags.o thread.o threads.o) ++ +diff --git a/configure b/configure +index d14e7d1..7df3b29 100755 +--- a/configure ++++ b/configure +@@ -21,6 +21,7 @@ srcdir=$(dirname "$0") + + subdirs="util compat lib parse-time-string completion doc emacs" + subdirs="${subdirs} performance-test test test/test-databases" ++subdirs="${subdirs} bindings" + + # For a non-srcdir configure invocation (such as ../configure), create + # the directory structure and copy Makefiles. +@@ -426,6 +427,15 @@ else + have_doxygen=0 + fi + ++printf "Checking for ruby development files... " ++if ruby -e "require 'mkmf'"> /dev/null 2>&1; then ++ printf "Yes.\n" ++ have_ruby_dev=1 ++else ++ printf "No (skipping ruby bindings)\n" ++ have_ruby_dev=0 ++fi ++ + printf "Checking if sphinx is available and supports nroff output... " + if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then + printf "Yes.\n" +@@ -848,6 +858,10 @@ HAVE_CANONICALIZE_FILE_NAME = ${have_canonicalize_file_name} + # build its own version) + HAVE_GETLINE = ${have_getline} + ++# Are the ruby development files (and ruby) available? If not skip ++# building/testing ruby bindings. ++HAVE_RUBY_DEV = ${have_ruby_dev} ++ + # Whether the strcasestr function is available (if not, then notmuch will + # build its own version) + HAVE_STRCASESTR = ${have_strcasestr} +@@ -958,6 +972,10 @@ NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact} + # Whether there's either sphinx or rst2man available for building + # documentation + NOTMUCH_HAVE_MAN=$((have_sphinx || have_rst2man)) ++ ++# Are the ruby development files (and ruby) available? If not skip ++# building/testing ruby bindings. ++NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev} + EOF + + # Finally, after everything configured, inform the user how to continue. +-- +2.1.3 + -- 2.26.2