Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 475624 - dev-ruby/notmuch-ruby - ruby bindings for net-mail/notmuch
Summary: dev-ruby/notmuch-ruby - ruby bindings for net-mail/notmuch
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Default Assignee for New Packages
URL:
Whiteboard:
Keywords: EBUILD, PATCH
Depends on: 444828
Blocks:
  Show dependency tree
 
Reported: 2013-07-03 12:24 UTC by Franz Trischberger
Modified: 2019-05-18 09:45 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
notmuch-0.15.2.ebuild - modified (notmuch-0.15.2.ebuild,4.55 KB, text/plain)
2013-07-03 12:24 UTC, Franz Trischberger
Details
ruby_fix_UINT2FIX.patch (ruby_fix_UINT2FIX.patch,729 bytes, patch)
2013-07-03 12:25 UTC, Franz Trischberger
Details | Diff
dev-ruby/notmuch-ruby-0.18.1.ebuild (notmuch-ruby-0.18.1.ebuild,909 bytes, text/plain)
2014-10-07 07:51 UTC, Franz Trischberger
Details
notmuch-ruby-0.18.1-build_standalone.patch (notmuch-ruby-0.18.1-build_standalone.patch,813 bytes, patch)
2014-10-07 07:52 UTC, Franz Trischberger
Details | Diff
notmuch-ruby-0.18.1.ebuild (notmuch-ruby-0.18.1.ebuild,854 bytes, text/plain)
2014-10-22 11:29 UTC, Franz Trischberger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franz Trischberger 2013-07-03 12:24:24 UTC
Created attachment 352518 [details]
notmuch-0.15.2.ebuild - modified

The next release of notmuch will have a replacement for notmuch-vim written in ruby. This requires building of the ruby bindings.
I just tried around getting the bindings built with ruby-ng.eclass, but did not succeed - help is very appreciated! As ruby18 will be removed from portage sooner or later I sticked with ruby19 for the moment and simply used the bindings function. Current release also requires a patch to properly link.
Comment 1 Franz Trischberger 2013-07-03 12:25:02 UTC
Created attachment 352520 [details, diff]
ruby_fix_UINT2FIX.patch
Comment 2 Jeroen Roovers gentoo-dev 2013-07-03 13:20:24 UTC
Comment on attachment 352518 [details]
notmuch-0.15.2.ebuild - modified

--- notmuch-0.15.2.ebuild       2013-03-10 20:40:06.780636776 +0100
+++ -   2013-07-03 15:20:14.966709944 +0200
@@ -21,7 +21,7 @@
        pick? ( emacs )
        test? ( crypt emacs python )
        "
-IUSE="bash-completion crypt debug doc emacs mutt nmbug pick python test vim
+IUSE="bash-completion crypt debug doc emacs mutt nmbug pick python ruby test vim
        zsh-completion"
 
 CDEPEND="
@@ -32,6 +32,7 @@
        debug? ( dev-util/valgrind )
        emacs? ( >=virtual/emacs-23 )
        x86? ( >=dev-libs/xapian-1.2.7-r2 )
+       ruby? ( dev-lang/ruby:1.9 )
        vim? ( || ( >=app-editors/vim-7.0 >=app-editors/gvim-7.0 ) )
        "
 DEPEND="${CDEPEND}
@@ -51,7 +52,7 @@
        zsh-completion? ( app-shells/zsh )
        "

-PATCHES=( )
+PATCHES=( "${FILESDIR}/ruby_fix_UINT2FIX.patch"  )
 DOCS=( AUTHORS NEWS README )
 SITEFILE="50${PN}-gentoo.el"
 SITEFILE_PICK="60${PN}-pick-gentoo.el"
@@ -66,6 +67,15 @@
        fi
 }

+compile_ruby() {
+       ruby19 extconf.rb || die "ruby config failed"
+       emake || die "ruby compile failed"
+}
+
+install_ruby() {
+       emake DESTDIR="${D}" install || die "ruby install failed"
+}
+
 pkg_setup() {
        if use emacs; then
                elisp-need-emacs 23 || die "Emacs version too low"
@@ -108,6 +118,7 @@
 src_compile() {
        default
        bindings python distutils_src_compile
+       bindings ruby compile_ruby

        if use mutt; then
                pushd contrib/notmuch-mutt || die
@@ -169,6 +180,7 @@
        fi
        
        DOCS="" bindings python distutils_src_install
+       bindings ruby install_ruby

        if use doc; then
                bindings python dohtml -r python
Comment 3 Amadeusz Żołnowski gentoo-dev 2013-07-07 08:46:47 UTC
Franz, thanks for patches. Jer, thanks for fixing. :-)

(Franz, you don't have to add yourself to CC since you are the reporter.)
Comment 4 Franz Trischberger 2013-07-07 09:07:35 UTC
(In reply to Amadeusz Żołnowski from comment #3)
> Franz, thanks for patches. Jer, thanks for fixing. :-)
Great to hear :)

> (Franz, you don't have to add yourself to CC since you are the reporter.)
That happened automatically when attaching the ebuild.
Comment 5 Amadeusz Żołnowski gentoo-dev 2013-07-08 18:29:54 UTC
I have committed changes to live ebuild in my overlay for now. I am going to move these changes to official repo with upcoming 0.16 release.

Changes include:
- ruby bindings
- new UI for Vim
- cosmetic changes
Comment 6 Amadeusz Żołnowski gentoo-dev 2013-07-08 18:33:11 UTC
(In reply to Amadeusz Żołnowski from comment #5)
> I have committed changes to live ebuild in my overlay for now.

To test:

# layman -a aidecoe
# layman -S
# echo '=net-mail/notmuch-9999 **' >> /etc/portage/package.keywords

Edit /etc/portage/package.use to add missing flags (possibly: ruby, vim).

# emerge =net-mail/notmuch-9999

And enjoy. :-)
Comment 7 Amadeusz Żołnowski gentoo-dev 2013-08-03 20:34:43 UTC
I am sorry, but I am not going to fix it. The simple approach provided by jer doesn't work as good as I hoped. Multiple Ruby targets are required here.

Adding Ruby bindings support is not so trivial. To make it working correctly, ruby-ng eclass needs to be used. Until somebody with more patience to Ruby adds support for it, notmuch ebuild doesn't support neither Vim UI nor Ruby bindings. I am not going to touch Ruby bindings myself anymore.
Comment 8 Amadeusz Żołnowski gentoo-dev 2013-08-03 20:36:54 UTC
Hello Ruby team. If somebody of you would be interested in adding support for Ruby bindings in notmuch-0.16, I'd be grateful. :-) If not, please ignore it.
Comment 9 Franz Trischberger 2013-11-05 07:45:44 UTC
I just added a standalone package "notmuch-ruby". It works so far, but there are still some things I am not sure about - TODO in the commit message. Any ideas?

https://github.com/ff2000/gentoo-overlay/commit/f3cd82b63a69efbd08d254dc225a09e14f837578

Concerning notmuch-vim:
I do not use the one bundled with notmuch, I use a direct git clone from
https://github.com/felipec/notmuch-vim-ruby
Comment 10 Amadeusz Żołnowski gentoo-dev 2013-11-05 07:54:24 UTC
Hi Franz!

Thank you for you ebuild, but please have in mind that notmuch-ruby bindings will not get into tree until new ruby eclass is ready (bug #444828).
Comment 11 Franz Trischberger 2013-11-05 08:07:49 UTC
(In reply to Amadeusz Żołnowski from comment #10)
> Hi Franz!
> 
> Thank you for you ebuild, but please have in mind that notmuch-ruby bindings
> will not get into tree until new ruby eclass is ready (bug #444828).

Yes, I know that report. That's the reason I finally stripped out the bindings into a new ebuild:
https://bugs.gentoo.org/show_bug.cgi?id=444828#c1
I just wanted to to get the bindings and share the result (probably it's useful for others :)) As I use notmuch-vim mostly for testing I am happy with it.
Comment 12 Franz Trischberger 2014-10-07 07:50:56 UTC
As there seems to be some interest in improving notmuch-vim (Ian Main pushed quite some patches to the ML/his github fork) I wanted to start playing around with it again. Therefor I created notmuch-ruby-0.18.1.ebuild. Will attach it and a new version of the build_standalone patch.
Comment 13 Franz Trischberger 2014-10-07 07:51:52 UTC
Created attachment 386176 [details]
dev-ruby/notmuch-ruby-0.18.1.ebuild
Comment 14 Franz Trischberger 2014-10-07 07:52:29 UTC
Created attachment 386178 [details, diff]
notmuch-ruby-0.18.1-build_standalone.patch
Comment 15 Amadeusz Żołnowski gentoo-dev 2014-10-07 09:33:16 UTC
@ruby team: could you review it and possibly take it under your wings?
Comment 16 Hans de Graaff gentoo-dev 2014-10-19 14:20:42 UTC
(In reply to Franz Fellner from comment #13)
> Created attachment 386176 [details]
> dev-ruby/notmuch-ruby-0.18.1.ebuild

DEPEND="=net-mail/notmuch-${PV}"
RDEPEND="${DEPEND}"
PDEPEND="dev-ruby/mail"

This won't work well with ruby-ng.eclass since it also manipulates DEPEND and RDEPEND. I'd write this as 

DEPEND+="=net-mail/notmuch-${PV}"
RDEPEND+="=net-mail/notmuch-${PV}"

I'm not sure why you use PDEPEND here because I assume this is a runtime dependency. In that case you should use the ruby_add_rdepend() method to add the dependency to ensure that ruby version USE flags are properly propagated. Also note that dev-ruby/mail is slotted and each slots has API differences, so your version may need to be more precise.

For emake it's better to use "emake V=1 ..." since that triggers verbose build mode, which some of the QA tools use.

For bindings that are spun out of other packages I think it makes more sense for the original package maintainer to be the primary maintainer, but feel free to add it to the ruby herd so we can help with general ruby issues.
Comment 17 Franz Trischberger 2014-10-22 11:29:16 UTC
Created attachment 387202 [details]
notmuch-ruby-0.18.1.ebuild

Changes applied as requested.
dev-ruby/mail DEP was taken from the vim deps, AFAIR I initially wanted to add a USE="vim" to notmuch-ruby, which turned out to be not what I REALLY wanted, but I forgot the DEP... (USE="vim" for net-mail/notmuch should PDEPEND on notmuch-ruby and dev-ruby/mail, I think)
Comment 18 Amadeusz Żołnowski gentoo-dev 2017-05-29 17:08:54 UTC
The given approach is to provide ruby bindings by separate package, but I really don't want to maintain ruby packages. Reassigning to proxy maintainers.
Comment 19 Thomas Schneider 2018-05-09 13:44:51 UTC
I have submitted a patch[0] to notmuch to allow building for a different ruby version, but I have not yet succeeded to make use of this in the ebuild.  Someone who understands ruby-ng.eclass might.

[0]: https://notmuchmail.org/pipermail/notmuch/2018/026528.html
Comment 20 Hans de Graaff gentoo-dev 2018-05-20 06:33:08 UTC
(In reply to Amadeusz Żołnowski from comment #18)
> The given approach is to provide ruby bindings by separate package, but I
> really don't want to maintain ruby packages. Reassigning to proxy
> maintainers.

The ruby team could be a co-maintainer on this package and help with the ruby side of things.