On 2023-04-19 01:08:23, Ralph Seichter wrote:
> I need to install Ruby bindings (something.so) during an ebuild,
> specifically into the /usr/lib64/ruby/vendor_ruby/3.0.0/x86_64-linux
> directory.

Hey Ralph. I'm not an expert on the ruby eclasses, but they work more
or less like the python ones, if that helps at all.

In this case, it looks like you have a package that builds a binary
ruby extension. That extension should be married to a specific version
of ruby, namely the one it was built against. I think the best way to
support that in a package is to declare which ruby versions are
supported with USE_RUBY and ruby-ng.eclass. USE_RUBY will be cross-
referenced with the user's RUBY_TARGETS to determine which ruby
versions are ultimately supported. Then, parts of the ebuild will be
repeated for each ruby version that the ebuilds supports and that the
user wants.

You can fine-tune what happens in each phase with the eclass functions
each_ruby_<phase>. So for example, if this is a C package, you might
only want to run ./configure && make extension && make install-extension
in the separate version-specific phases, so as to avoid rebuilding the
whole entire package for each version of ruby.

As always, the devil is in the details, but ruby-ng.eclass is a good
starting point.

Reply via email to