unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Thomas Schneider <qsx@chaotikum.eu>
To: notmuch@notmuchmail.org
Subject: [RFC PATCH] build: Add meson.build for Ruby bindings
Date: Mon, 17 Feb 2020 12:10:19 +0100	[thread overview]
Message-ID: <20200217111019.231584-1-qsx@chaotikum.eu> (raw)
In-Reply-To: <20200111164049.8237-1-jani@nikula.org>

It seems to work so far and doesn’t depend on Ruby’s MakeMakefile, as
the current Makefile does.  However, there is currently no way to
configure a certain Ruby version to build against (the first one that
works is used).

Given that the Ruby bindings themselves are a bit unmaintained, it might
make sense to rewrite them altogether in Ruby using ffi[0].

[0]: https://github.com/ffi/ffi

---
 bindings/ruby/meson.build | 21 +++++++++++++++++++++
 meson.build               |  8 ++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 bindings/ruby/meson.build

diff --git a/bindings/ruby/meson.build b/bindings/ruby/meson.build
new file mode 100644
index 00000000..1b482107
--- /dev/null
+++ b/bindings/ruby/meson.build
@@ -0,0 +1,21 @@
+libnotmuch_ruby_srcs = [
+  'database.c',
+  'directory.c',
+  'filenames.c',
+  'init.c',
+  'message.c',
+  'messages.c',
+  'query.c',
+  'status.c',
+  'tags.c',
+  'thread.c',
+  'threads.c',
+]
+
+lib_notmuch_ruby = library('notmuch', libnotmuch_ruby_srcs,
+			   include_directories: [inc_compat,
+						 inc_lib],
+			   link_with: [lib_notmuch],
+			   dependencies: [dep_ruby],
+			   install: true,
+			   install_dir: dep_ruby.get_pkgconfig_variable('vendorarchdir'))
diff --git a/meson.build b/meson.build
index 6a924a68..0cf3dd68 100644
--- a/meson.build
+++ b/meson.build
@@ -11,6 +11,13 @@ dep_talloc = dependency('talloc')
 dep_valgrind = dependency('valgrind', required: false)
 dep_bash_completion = dependency('bash-completion', version: '>=1.90',
 				 required: false)
+ruby_versions = ['2.7', '2.6', '2.5']
+foreach v : ruby_versions
+  dep_ruby = dependency('ruby-@0@'.format(v))
+  if dep_ruby.found()
+    break
+  endif
+endforeach
 cmd_python = find_program('python3', 'python', 'python2')
 cmd_doxygen = find_program('doxygen', required: false)
 cmd_ruby = find_program('ruby', required: false)
@@ -29,6 +36,7 @@ subdir('compat')
 subdir('parse-time-string')
 subdir('util')
 subdir('lib')
+subdir('bindings/ruby')
 subdir('test')
 
 notmuch_client_srcs = [
-- 
2.25.0

      parent reply	other threads:[~2020-02-17 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-11 16:40 [RFC PATCH] build: add meson build system Jani Nikula
2020-01-12 12:20 ` David Bremner
2020-01-12 13:42   ` Jani Nikula
2020-01-12 15:07     ` Tomi Ollila
2020-02-17 11:10 ` Thomas Schneider [this message]

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=20200217111019.231584-1-qsx@chaotikum.eu \
    --to=qsx@chaotikum.eu \
    --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).