[Rubygems-developers] rubygems integration with Gentoo Linux

Nguyễn Thái Ngọc Duy pclouds at gentoo.org
Tue Sep 5 21:13:53 EDT 2006

I'm maintaining gem packages in Gentoo Linux and having some concerns
about rubygems, including source patching, extensions clean install
and gem cache.

The first issue is source patching. It is needed when I want to fix
some minor issues without waiting for upstream maintainers to release
a new gem package. Currently there is no way to do this, IMO, because
gem installation is a one-step action. If Gem::Installer#install is
splitted into smaller functions, like unpack, compile and install,
then distros like Gentoo could reuse those functions to do patching
when needed.

The second issue is not really important though. I notice that gem
does compile extensions in install_dir. This leaves temporary files in
install_dir such as .o files and others. I'd rather install clean
package in my system. This could be done if extensions are compiled in
a temporary directory and then installed into install_dir.

The last one is a feature request. Correct me if I'm wrong. It seems
*.gem files in cache directory are not essential. Gentoo already cache
downloaded files in /usr/portage/distfiles so keeping another versions
is not neccesary. Therefore I'd request an option in "gem install" to
not cache gem packages.

For the first and second issue, I can solve it if Installer#install is
splitted into several parts. I cooked up a patch for this. The patch
reduces Installer#install and call three functions: unpack, compile
and real_install to do its task. @directory is removed because only
generate_bin_symlink uses it. This patch should not change "gem
install" behaviour. However because I change generate_bin and
build_extensions call order, this might have side effects.
The patch also contains several changes in gem_commands.rb and
cmd_manager.rb to:
 - add "gem compile" to export Installer#compile
 - add option --all to "gem unpack" to be able to unpack any gem
package, --target-dir to unpack to specified directory
 - add option --partial to "gem install" to export Installer#real_install

I'm looking for other solutions as well. Comments are highly appreciated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ggem.patch
Type: text/x-patch
Size: 12443 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rubygems-developers/attachments/20060906/f802bdd2/attachment.bin 

More information about the Rubygems-developers mailing list