FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 03-03-2009, 03:47 PM
Alex Legler
 
Default gems.eclass review

Hey,

we have some changes to be made in gems.eclass for Ruby 1.9.1.
Basically this introduces the possibility to install gems for multiple
versions of Ruby.

If anyone feels like reviewing, please review the following changes:

http://dev.gentoo.org/~a3li/ruby/gems.eclass.txt
Diff against the current version in the tree:
http://dev.gentoo.org/~a3li/ruby/gems.eclass.diff

Regards,
Alex
 
Old 03-07-2009, 02:03 AM
Ryan Hill
 
Default gems.eclass review

On Tue, 03 Mar 2009 17:47:58 +0100
Alex Legler <a3li@gentoo.org> wrote:

> Hey,
>
> we have some changes to be made in gems.eclass for Ruby 1.9.1.
> Basically this introduces the possibility to install gems for multiple
> versions of Ruby.
>
> If anyone feels like reviewing, please review the following
> changes:

> + # I'm not sure how many ebuilds have correctly set USE_RUBY - let's assume
> + # ruby18 if they haven't, since even pure Ruby gems that have been written
> + # against 1.8 can explode under 1.9.
> + if [[ -z "${USE_RUBY}" ]]; then
> + USE_RUBY="ruby18"
> + elif [[ "${USE_RUBY}" == "any" ]]; then
> + # Get the installed versions.
> + USE_RUBY=`ls /usr/bin/ruby* | grep -E 'ruby1(8|9)' | sed -e 's@/usr/bin/@@g'`
> fi
>
> + local num_ruby_slots=$(echo "${USE_RUBY}" | wc -w)
> +
> + for ruby_version in ${USE_RUBY} ; do
> + # Check that we have the version installed
> + [[ -e "/usr/bin/${ruby_version/ruby/gem}" ]] || continue


In the case that USE_RUBY is set to something funky, it never gets handled. The eclass
basically just does nothing. This might be what you want, but if not, how about something
like:

local my_ruby
if [[ -n ${USE_RUBY} ]]; then
if [[ ${USE_RUBY} == "any" ]]; then
for i in /usr/bin/ruby1*; do
[[ -f ${i} ]] && my_ruby="${my_ruby} ${i}"
done
elif [[ -x /usr/bin/${USE_RUBY} ]]; then
my_ruby=${USE_RUBY}
else
die "Some error message about a bad USE_RUBY value"
fi

else
my_ruby="ruby18"
fi

set -- ${my_ruby}
local num_ruby_slots=${#@}




> + einfo "Installing for ${ruby_version}..."
> + gems_location ${ruby_version}
> + dodir ${GEMSDIR}

|| die

> + if [[ -d "${D}/${GEMSDIR}/bin" ]] ; then
> + exeinto /usr/bin
> + for exe in "${D}"/${GEMSDIR}/bin/* ; do
> + if [ "$num_ruby_slots" -ge 2 ] ; then
> + # Ensures that the exe file gets run using the currently
> + # selected version of ruby.
> + sed -i -e 's@^#!/usr/bin/ruby.*$@#!/usr/bin/ruby@' "${exe}"
> + fi
> + doexe "${exe}"

|| die


--
gcc-porting, by design, by neglect
treecleaner, for a fact or just for effect
wxwidgets @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662
 
Old 03-12-2009, 07:02 PM
Alex Legler
 
Default gems.eclass review

On Fr, 2009-03-06 at 21:03 -0600, Ryan Hill wrote:
> In the case that USE_RUBY is set to something funky, it never gets handled. The eclass
> basically just does nothing. This might be what you want, but if not, how about something
> like:
>

Actually, this is what we want.
I noticed after I sent the eclass for review, that USE_RUBY="any" should
not be used anymore. So I added a deprecation notice and will get rid of
it in a month or so.

> > + dodir ${GEMSDIR}
>
> || die
>

Added the two die's, thanks.

I also added eclass-manpages-style documentation and empty EAPI-2
functions to make pva happy.

I am going to wait another couple of days before comitting if anyone
should have more comments. Updated the old URLs with the new changes:

http://dev.gentoo.org/~a3li/ruby/gems.eclass.txt
http://dev.gentoo.org/~a3li/ruby/gems.eclass.diff

Thanks,
Alex
 
Old 03-14-2009, 05:02 PM
Peter Volkov
 
Default gems.eclass review

В Чтв, 12/03/2009 в 21:02 +0100, Alex Legler пишет:
> http://dev.gentoo.org/~a3li/ruby/gems.eclass.txt
> http://dev.gentoo.org/~a3li/ruby/gems.eclass.diff

You have:

EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install

I'm not sure here. Is it safe to export src_prepare function for
EAPI=0,1? If not I think eclass should either die or put some fake
depend like:

case ${EAPI} in
2) : ;;
*) DEPEND="INCORRECT-EAPI" ;;
esac

--
Peter.
 
Old 03-14-2009, 05:53 PM
Ciaran McCreesh
 
Default gems.eclass review

On Sat, 14 Mar 2009 21:02:45 +0300
Peter Volkov <pva@gentoo.org> wrote:
> I'm not sure here. Is it safe to export src_prepare function for
> EAPI=0,1?

Nope. You're only allowed to EXPORT_FUNCTIONS something that's a phase
function for your chosen EAPI.

(Incidentally, you're also only allowed to call EXPORT_FUNCTIONS once
per eclass. I seem to recall this being for historical reasons.)

--
Ciaran McCreesh
 

Thread Tools




All times are GMT. The time now is 02:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org