While writing an ebuild for RMagick 1.14.1 I encountered the problem that the ebuild would try to write the installation files directly into the live filesystem instead of into the image directory, see #155646 for details. The problem is that the setup.rb file distributed with RMagick 1.14.1 does not look at the config data when installing. Giving it an explicit --prefix during the installation step solves this, and that is what I've done in the ebuild for RMagick. However, as kernelsensei mentions in that bug, this could well affect more ruby packages and may indicate that the bug is actually in ruby.eclass. Since I'm not very familiar yet with ruby packaging I'd rather open this bug about it rather than mucking about with the eclass. Questions to look in to: - Do we have any other ruby packages that use setup.rb? If so, do they also create access violations? - Is the setup.rb in RMagick generic (which means we should adapt the eclass), or custom? - Would it hurt other packages if we would give the --prefix option to setup.rb in the eclass always, to cover both cases.
Hi, I contacted the Rmagick main dev and he said that the setup.rb is generic : http://i.loveruby.net/en/projects/setup/
Hmm, I didn't write the ruby eclass so I can't answer whether --prefix would cause an issue or not. But, perhaps we can try it and see what happens!
My main concern is that we'd break existing packages using setup.rb. However, given that RMagick uses a standard setup.rb and that we install most packages as a gem that chance may not be very large.
Created attachment 103639 [details] setup.rb collection I did a quick grep over dev-ruby to find non-gem packages, fetched them all and extract setup.rb. There are only 12 packages that have setup.rb. There are some very different setup.rb implementations. I think racc's setup.rb is more standard than RMagick's according to diff. Anyway 12 is not a big deal, just test them all :)
I'm not really sure whether this is a good move. fusefs-0.6.0 fails to install if I append either --prefix=${D} or --prefix=${D}/usr BTW Hans, may I know why you use --prefix=${D} instead of --prefix=${D}/usr in rmagick ebuild?
I used --prefix=${D} because it worked. :-) I initially tried to use --prefix=${D}/usr but the package ended up in /usr/usr/bin etc. After investigating a bit more I've found the following: 'setup.rb install --prefix' determines the directory where the actual files are written, but respecting the --prefix given in the config step. So for Gentoo the install --prefix must be ${D}. Normally this would be / which is the default. The 'setup.rb config --prefix' step seem to be redundant then, because it defaults to /usr. Leaving out would work fine, because all files would assume to be under /usr due to the default --prefix, and then written to ${D} due to the install --prefix. But... ...the post-install.rb script doesn't care at all about the install --prefix and only checks the config --prefix. So we need to do both to get everything to end up in the right place.
I think we can mark this as WONTFIX, ruby-ng.eclass does no longer have template functions for setup.rb.