Hi folks,
I'm writing a quick summary of what I managed to achieve with JRuby/Fedora
implementation so far. You can try out my repo at [1] and see the progress of work on
jruby.spec at [2].
- I have managed to remove the RubyGems copy from JRuby and make them work with our system
RubyGems - I had to apply few JRuby specific patches there - two are already accepted
upstream, but not merged into the 1.8 tree, one is still pending [3]. The updated RubyGems
are also in the mentioned repo and please be careful when installing them, preferably use
mock.*
- As a part of the RubyGems modifications, I have also prepared a sample gem
(rubygem-json, also in the repository), with a rubygem-json-java subpackage, that provides
Java extensions for JRuby.
- Pure Gems from Fedora now work with JRuby out of the box, no modification needed.
- "jgem" command works exactly as "gem", only using JRuby - nice,
isn't it? :)
- load paths set has been brought much closer to MRI, which allowed most of the stuff I
have done
TODO:
- I'm still unsure what is the best way to set up the Provides/Requires, so that
RubyGems would be installable without MRI, only with JRuby. I guess we can live with JRuby
dragging in Ruby, that's a small problem for now :)
- Some modifications to Guidelines will be needed, explaining how to build Gems/non-Gems
for JRuby.
- I will also add a jruby-devel package with macros.jruby to match MRI's behaviour
closely.
* The reason for this is, that I have also tried to introduce new naming scheme for Gems
extensions dirs, which is not compatible with the current one. So far, the %gem_extdir was
"/usr/lib[64]/gems/exts". With Rubinius and JRuby comming, there is a slight
problem - extensions for JRuby should of course go under /usr/share/gems/exts, but
Rubinius extensions would have problems, as they should go under %gem_extdir, too.
Therefore, I'd like to propose this scheme for extension placement:
%gem_extdir %{_libdir}/gems/ruby # MRI
%xgem_extdir %{_libdir}/gems/rubinius # Rubinius, not sure if that should be named
"xgem_extdir", what do the others think?
%jgem_extdir %{_datadir}/gems/jruby #JRuby # JRuby
This logic to implement this is very simple and it all goes to
defaults/operating_system.rb in the updated rubygems package in my repo (specfile is a bit
adjusted, too).
There is also a question of versioning these dirs, mainly Rubinius exts, but I'm
leaving that for future, comment if you have any good ideas :)
Thanks goes to Charles Nutter for taking the JRuby RubyGems close to upstream, which was
very important from Fedora integration POV :)
Slavek.
--
Regards,
Bohuslav "Slavek" Kabrda.
[1]
http://bkabrda.fedorapeople.org/jruby/jruby.repo
[2]
https://github.com/bkabrda/jruby.spec
[3]
https://github.com/rubygems/rubygems/pull/371