FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(CONFIGURE_LDFLAGS)
.PHONY: all
-all: notmuch notmuch-shared build-man
+all: notmuch notmuch-shared build-man ruby-bindings
ifeq ($(MAKECMDGOALS),)
ifeq ($(shell cat .first-build-message 2>/dev/null),)
@NOTMUCH_FIRST_BUILD=1 $(MAKE) --no-print-directory all
--- /dev/null
+# -*- makefile -*-
+
+dir := bindings
+
+# force the shared library to be built
+ruby-bindings: lib/libnotmuch.so
+ifeq ($(HAVE_RUBY_DEV),1)
+ cd $(dir)/ruby && ruby extconf.rb --vendor
+ $(MAKE) -C $(dir)/ruby
+else
+ @echo Missing dependency, skipping ruby bindings
+endif
+
+CLEAN += $(patsubst %,$(dir)/ruby/%, \
+ .RUBYARCHDIR.time \
+ 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)
--- /dev/null
+To build the the notmuch ruby extension, run the following commands
+from the *top level* notmuch source directory:
+
+% ./configure
+% make ruby-bindings
+
+The generic documentation about building notmuch also applies.
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.
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 command -v sphinx-build > /dev/null && ${python} -m sphinx.writers.manpage > /dev/null 2>&1 ; then
printf "Yes.\n"
# 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}
# Name of python interpreter
NOTMUCH_PYTHON=${python}
+
+# 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.
dh_auto_build -- V=1
dh_auto_build --sourcedirectory bindings/python
cd bindings/python && $(python3_all) setup.py build
- cd bindings/ruby && ruby extconf.rb --vendor && make
$(MAKE) -C contrib/notmuch-mutt
override_dh_auto_clean: