Excerpts from Hans de Graaff's message of Sat Jun 18 08:16:25 +0200 2011:
> Stanislav asked me to review. I'm also including the list since other
> people may also be interested how to handle ruby ebuilds.
> 
> On Wed, 2011-06-15 at 22:04 +0000, Stanislav Ochotnicky (sochotnicky)
> wrote:
> > sochotnicky    11/06/15 22:04:56
> > 
> >   Added:                metadata.xml ChangeLog fromcvs-0_pre132.ebuild
> >   Log:
> >   New ebuild for fromcvs added to the tree. Fixes #173341
> >   
> 
> > EAPI=2
> > 
> > USE_RUBY="ruby18 ree18"
> > 
> > #mercurial after ruby!
> > inherit ruby-ng mercurial
> > 
> > MY_PV="${PV#0_pre}"
> > 
> > DESCRIPTION="fromcvs converts cvs to git and hg"
> > HOMEPAGE="http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs";
> > SRC_URI=""
> > EHG_REPO_URI="http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs";
> > EHG_REVISION="${MY_PV}"
> > 
> > LICENSE="BSD-4"
> > SLOT="0"
> > KEYWORDS="~amd64"
> > IUSE="test"
> > 
> > RUBY_S="${PN}-${PV}"
> 
> RUBY_S is only supported in EAPI=4. You are getting away with this
> because you are using a custom unpack method.
> 

Good to know. Moved to EAPI4, with it few "|| die" things went away.

> > RDEPEND="dev-ruby/rcsparse >=dev-ruby/rbtree-0.3.0-r2 dev-vcs/git"
> 
> The ruby-ng eclasses frob RDEPEND, so you should always add to it, e.g.
> 
> RDEPEND="${RDEPEND} dev-vcs/git"
> 
> Also, all ruby dependencies should be handled via ruby_add_rdepend to
> ensure that your list in USE_RUBY is properly passed down to the
> dependencies:
> 
> ruby_add_rdepend "dev-ruby/rcsparse >=dev-ruby/rb-tree-0.3.0-r2"

Fixed

> > # this is a workaround because combination of ruby-ng and mercurial is
> > # not working correctly for unpacking
> > src_prepare() {
> >     for rubyv in ${USE_RUBY};do
> 
> Missing "all" target.
> 

Fixed.

> >         mkdir "${WORKDIR}/${rubyv}"
> 
> || die
> 
> >         cp -prl "${S}" "${WORKDIR}/${rubyv}/${RUBY_S}"
> 
> || die
>

Fixed on second iteration :-)

> >     done
> > }
> > 
> > each_ruby_install() {
> >     siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitedir"]')
> >     insinto ${siteruby}
> 
> insinto ruby_rbconfig("sitedir")
This didn't really work so I used 
 insinto $(ruby_rbconfig_value 'sitedir')

> >     doins *.rb || die "Installation of rb files failes"
> 
> Typo.

Fixed

> 
> > 
> >     make_script togit
> >     make_script tohg
> > }
> > 
> > make_script() {
> >     echo "ruby /usr/$(get_libdir)/ruby/site_ruby/$1.rb \$@" > $1
> 
> I'm not sure how this should work? Perhaps you mean something like:
> 
> echo "#!/usr/bin/ruby ..."
> 

In the end I fixed up upstream scripts because they had no shebangs and
isntalled them directly without any wrappers. They still use
/usr/bin/ruby where it would be nicer to have specific script for each
ruby version.

> >     dobin $1
> 
> || die, (or use EAPI=4)

EAPI4 it is

-- 
Stanislav Ochotnicky

PGP: 7B087241
jabber: stanis...@ochotnicky.com

Attachment: signature.asc
Description: PGP signature

Reply via email to